Yaron Koren has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/342895 )
Change subject: Attempted fix for OpenLayers/WikiEditor loading problem
......................................................................
Attempted fix for OpenLayers/WikiEditor loading problem
Change-Id: Ic0149ce47c0c1eff244b9a17b0cc65b388d9e8cf
---
M includes/PF_Hooks.php
1 file changed, 15 insertions(+), 7 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PageForms
refs/changes/95/342895/2
diff --git a/includes/PF_Hooks.php b/includes/PF_Hooks.php
index f2859da..67a445c 100644
--- a/includes/PF_Hooks.php
+++ b/includes/PF_Hooks.php
@@ -65,13 +65,21 @@
* @return bool Always true
*/
public static function registerModules( ResourceLoader &$resourceLoader
) {
+ global $wgExtensionAssetsPath;
+
+ // These all used to use a value of __DIR__ for 'localBasePath',
+ // but apparently, in some installations, that had a value of
+ // /PageForms/libs and in others just /PageForms, so we'll use
+ // an absolute path instead.
+ $pageFormsDir = $wgExtensionAssetsPath . '/PageForms';
+
if ( class_exists( 'WikiEditorHooks' ) ) {
$resourceLoader->register( array(
'ext.pageforms.wikieditor' => array(
- 'localBasePath' => __DIR__,
+ 'localBasePath' => $pageFormsDir,
'remoteExtPath' => 'PageForms',
- 'scripts' =>
'/../libs/PF_wikieditor.js',
- 'styles' =>
'/../skins/PF_wikieditor.css',
+ 'scripts' => 'libs/PF_wikieditor.js',
+ 'styles' => 'skins/PF_wikieditor.css',
'dependencies' => array(
'ext.pageforms.main',
'jquery.wikiEditor'
@@ -83,9 +91,9 @@
if ( version_compare( $GLOBALS['wgVersion'], '1.26c', '>' ) &&
ExtensionRegistry::getInstance()->isLoaded( 'OpenLayers' ) ) {
$resourceLoader->register( array(
'ext.pageforms.maps' => array(
- 'localBasePath' => __DIR__,
+ 'localBasePath' => $pageFormsDir,
'remoteExtPath' => 'PageForms',
- 'scripts' =>
'/../libs/PF_maps.offline.js',
+ 'scripts' => 'libs/PF_maps.offline.js',
'dependencies' => array(
'ext.openlayers.main',
),
@@ -94,9 +102,9 @@
} else {
$resourceLoader->register( array(
'ext.pageforms.maps' => array(
- 'localBasePath' => __DIR__,
+ 'localBasePath' => $pageFormsDir,
'remoteExtPath' => 'PageForms',
- 'scripts' => '/../libs/PF_maps.js',
+ 'scripts' => 'libs/PF_maps.js',
),
) );
}
--
To view, visit https://gerrit.wikimedia.org/r/342895
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic0149ce47c0c1eff244b9a17b0cc65b388d9e8cf
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/PageForms
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits