resourceloader: Remove deprecated ResourceLoaderGetLessVars hook
authorTimo Tijhof <krinklemail@gmail.com>
Tue, 10 Apr 2018 14:07:18 +0000 (15:07 +0100)
committerTimo Tijhof <krinklemail@gmail.com>
Tue, 10 Apr 2018 14:11:00 +0000 (15:11 +0100)
Deprecated since 1.30, only had one caller (MobileFrontend)
which has been fixed since.

Bug: T140804
Change-Id: I39b594e3082ebe321bae463780cfadbfb3de1d5c

RELEASE-NOTES-1.31
docs/hooks.txt
includes/resourceloader/ResourceLoader.php

index 051f6d0..06d2c01 100644 (file)
@@ -334,6 +334,9 @@ changes to languages because of Phabricator reports.
 * HTMLForm & VFormHTMLForm::isVForm(), deprecated in 1.25, have been removed.
 * The ProfileSection class, deprecated in 1.25 and unused, has been removed.
 * Wikimedia\Rdbms\SavepointPostgres is deprecated.
+* The ResourceLoaderGetLessVars hook, deprecated in 1.30, has been removed.
+  Use ResourceLoaderModule::getLessVars() to expose local variables instead
+  of global ones.
 
 == Compatibility ==
 MediaWiki 1.31 requires PHP 5.5.9 or later. Although HHVM 3.18.5 or later is supported,
index f35d610..d932148 100644 (file)
@@ -2795,12 +2795,6 @@ configuration variables to JavaScript. Things that depend on the current page
 or request state must be added through MakeGlobalVariablesScript instead.
 &$vars: array( variable name => value )
 
-'ResourceLoaderGetLessVars': DEPRECATED! Called in ResourceLoader::getLessVars
-to add global LESS variables. Loaded after $wgResourceLoaderLESSVars is added.
-Global LESS variables are deprecated. Use ResourceLoaderModule::getLessVars()
-instead to expose variables only in modules that need them.
-&$lessVars: array of variables already added
-
 'ResourceLoaderJqueryMsgModuleMagicWords': Called in
 ResourceLoaderJqueryMsgModule to allow adding magic words for jQueryMsg.
 The value should be a string, and they can depend only on the
index 5ddb99b..90c3140 100644 (file)
@@ -1723,10 +1723,8 @@ MESSAGE;
         * @return array Map of variable names to string CSS values.
         */
        public function getLessVars() {
-               if ( !$this->lessVars ) {
-                       $lessVars = $this->config->get( 'ResourceLoaderLESSVars' );
-                       Hooks::run( 'ResourceLoaderGetLessVars', [ &$lessVars ] );
-                       $this->lessVars = $lessVars;
+               if ( $this->lessVars === null ) {
+                       $this->lessVars = $this->config->get( 'ResourceLoaderLESSVars' );
                }
                return $this->lessVars;
        }