Previously any module definition that specified a "class" was skipped. This
is problematic for custom modules that extend ResourceLoaderFileModule and
should be using the default paths.
Since we can't determine at initialization time whether a module class is a
ResourceLoaderFileModule or not, just add the default paths to all modules,
and leave it up to the individual classes to use the extra arguments or not.
Change-Id: Iee5d178343326030968755983f62629b81ef3c88
if ( isset( $data['localBasePath'] ) ) {
$data['localBasePath'] = "$dir/{$data['localBasePath']}";
}
- if ( $defaultPaths && !isset( $data['class'] ) ) {
+ if ( $defaultPaths ) {
$data += $defaultPaths;
}
$this->globals['wgResourceModules'][$name] = $data;
'test.class' => array(
'class' => 'FooBarModule',
'extra' => 'argument',
+ 'localBasePath' => $dir,
+ 'remoteExtPath' => 'FooBar',
),
'test.class.with.path' => array(
'class' => 'FooBarPathModule',
'extra' => 'argument',
'localBasePath' => $dir,
+ 'remoteExtPath' => 'FooBar',
)
),
),