Register ext.uls.eventlogger conditionally

The ext.uls.eventlogger module is now registered depending on
the configuration variable $wgULSEventLogging. This will prevent
the Structuretest Resourcetest to fail, if EventLogging isn't
installed on the test system (like on my jenkins environment :P).

Change-Id: I1e2545492ec04fb043638765ac42f09da89813e9
This commit is contained in:
Florian
2016-01-22 17:47:26 +01:00
committed by Nikerabbit
parent 701d5b19ed
commit 00349ab0eb
2 changed files with 15 additions and 10 deletions

View File

@@ -404,7 +404,7 @@ class UniversalLanguageSelectorHooks {
* @return boolean true
*/
public static function onResourceLoaderRegisterModules( ResourceLoader &$resourceLoader ) {
global $wgResourceModules;
global $wgResourceModules, $wgULSEventLogging;
if (
(
@@ -452,6 +452,20 @@ class UniversalLanguageSelectorHooks {
) );
}
if ( $wgULSEventLogging ) {
$resourceLoader->register( array(
'ext.uls.eventlogger' => array(
'scripts' => 'js/ext.uls.eventlogger.js',
'dependencies' => array(
'mediawiki.user',
'schema.UniversalLanguageSelector',
),
'localBasePath' => __DIR__ . '/resources',
'remoteExtPath' => 'UniversalLanguageSelector/resources',
),
) );
}
return true;
}
}

View File

@@ -163,15 +163,6 @@
"localBasePath": "resources",
"remoteExtPath": "UniversalLanguageSelector/resources"
},
"ext.uls.eventlogger": {
"scripts": "js/ext.uls.eventlogger.js",
"dependencies": [
"mediawiki.user",
"schema.UniversalLanguageSelector"
],
"localBasePath": "resources",
"remoteExtPath": "UniversalLanguageSelector/resources"
},
"ext.uls.i18n": {
"scripts": "js/ext.uls.i18n.js",
"dependencies": [