summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjdlrobson <jdlrobson@gmail.com>2021-08-17 10:33:43 -0700
committerMarkAHershberger <mah@nichework.com>2021-11-04 16:34:59 +0000
commit8358a512e3b812b9f3c75f37e821451166af1ada (patch)
treec084791118709d03ab8284475d8b546a5971a153
parent385e3a6a0e56c8ec7a17ef26cab61e928126d12a (diff)
Deprecate use of template directory relative to core
Warning now issued since skins have been updated. Additional change: Previously deprecations in release notes were in the wrong section (Relating to ResourceLoaderSkinModule) these are moved alongside the newly added deprecation note alongside other skin deprecations. Bug: T262067 Depends-On: I52bee67732cc72ec6857b6fc10cfbdd89ef9b8db Depends-On: I338198878e78cb5c6f47c53fdf18d3944655e965 Change-Id: Ic60524fe3c054706dbea15cc04235e979952e9f5
-rw-r--r--RELEASE-NOTES-1.372
-rw-r--r--includes/registration/ExtensionProcessor.php5
-rw-r--r--tests/phpunit/includes/registration/ExtensionProcessorTest.php1
3 files changed, 7 insertions, 1 deletions
diff --git a/RELEASE-NOTES-1.37 b/RELEASE-NOTES-1.37
index 4618f36a80d9..9cbe27015e55 100644
--- a/RELEASE-NOTES-1.37
+++ b/RELEASE-NOTES-1.37
@@ -684,6 +684,8 @@ because of Phabricator reports.
BaseTemplateAfterPortlet hook, which were deprecated in 1.35,
now emit deprecation warnings.
* The LocalFile::getHistory() hook is deprecated.
+* Previously the Skin templateDirectory option inside skin.json had to be
+ relative to MediaWiki core. This should now be relative to the skin.
* Calling WikiPage::prepareContentForEdit() without a UserIdentity is now
deprecated.
* User::getEditTokenObject(), ::getEditToken(), and ::matchEditToken() were each
diff --git a/includes/registration/ExtensionProcessor.php b/includes/registration/ExtensionProcessor.php
index b6b4212b9767..92982763cf49 100644
--- a/includes/registration/ExtensionProcessor.php
+++ b/includes/registration/ExtensionProcessor.php
@@ -638,8 +638,11 @@ class ExtensionProcessor implements Processor {
if ( is_dir( $correctedPath ) ) {
$data['args'][0]['templateDirectory'] = $correctedPath;
} else {
- // TODO: deprecate directories relative to core.
$data['args'][0]['templateDirectory'] = $templateDirectory;
+ wfDeprecatedMsg(
+ 'Template directory should be relative to skin or omitted.',
+ '1.37'
+ );
}
} elseif ( isset( $data['args'][0] ) ) {
// If not set, we set a sensible default.
diff --git a/tests/phpunit/includes/registration/ExtensionProcessorTest.php b/tests/phpunit/includes/registration/ExtensionProcessorTest.php
index 9fe702f23436..d1c675f9b231 100644
--- a/tests/phpunit/includes/registration/ExtensionProcessorTest.php
+++ b/tests/phpunit/includes/registration/ExtensionProcessorTest.php
@@ -63,6 +63,7 @@ class ExtensionProcessorTest extends MediaWikiIntegrationTestCase {
}
public function testExtractSkins() {
+ $this->expectDeprecation();
$processor = new ExtensionProcessor();
$processor->extractInfo( $this->dir, self::$default + [
'ValidSkinNames' => [