jenkins-bot has submitted this change and it was merged.

Change subject: Revert "Register resources with absolute path"
......................................................................


Revert "Register resources with absolute path"

The change broke beta with exception such as:

exception 'MWException' with message
'ResourceLoaderFileModule::readScriptFiles: script file not found:
"/usr/local/apache/common-local/php-master/er/extensions/MwEmbedSupport/MwEmbedModules/MediaWikiSupport/MediaWikiSupport.loader.js"'
in
/data/project/apache/common-local/php-master/includes/resourceloader/ResourceLoaderFileModule.php:574

bug: 50264
This reverts commit aadc1d0dd503ebb30ef4180d75b887c764b75fd3

Change-Id: Ie373d1f407788a8e2456c3d8a34cc79ac9ed8bb6
---
M MwEmbedResourceManager.php
M MwEmbedSupport.php
2 files changed, 4 insertions(+), 7 deletions(-)

Approvals:
  Hashar: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/MwEmbedResourceManager.php b/MwEmbedResourceManager.php
index 5ca4fe9..ada082b 100644
--- a/MwEmbedResourceManager.php
+++ b/MwEmbedResourceManager.php
@@ -19,15 +19,12 @@
         * @param $mwEmbedResourcePath string
         * @throws MWException
         */
-       public static function register( $localResourcePath ) {
+       public static function register( $mwEmbedResourcePath ) {
                global $IP, $wgExtensionMessagesFiles;
-
-               $mwEmbedResourcePath = substr( $localResourcePath, strlen( $IP 
. '/') );
-
+               $localResourcePath = $IP .'/' . $mwEmbedResourcePath;
                // Get the module name from the end of the path:
                $modulePathParts = explode( '/', $mwEmbedResourcePath );
                $moduleName =  array_pop ( $modulePathParts );
-
                if( !is_dir( $localResourcePath ) ){
                        throw new MWException( __METHOD__ . " not given 
readable path: "  . htmlspecialchars( $localResourcePath ) );
                }
diff --git a/MwEmbedSupport.php b/MwEmbedSupport.php
index baf74c4..da93165 100644
--- a/MwEmbedSupport.php
+++ b/MwEmbedSupport.php
@@ -53,7 +53,7 @@
 $wgHooks['ResourceLoaderGetConfigVars'][] =  
'MwEmbedResourceManager::registerConfigVars';
 
 // Register the core MwEmbed Support Module:
-MwEmbedResourceManager::register( dirname(__FILE__) . 
'/MwEmbedModules/MwEmbedSupport' );
+MwEmbedResourceManager::register( 
'extensions/MwEmbedSupport/MwEmbedModules/MwEmbedSupport' );
 
 // Register the MwEmbed 'mediaWiki' Module:
-MwEmbedResourceManager::register( dirname(__FILE__) . 
'/MwEmbedModules/MediaWikiSupport' );
+MwEmbedResourceManager::register( 
'extensions/MwEmbedSupport/MwEmbedModules/MediaWikiSupport' );

-- 
To view, visit https://gerrit.wikimedia.org/r/70806
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie373d1f407788a8e2456c3d8a34cc79ac9ed8bb6
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MwEmbedSupport
Gerrit-Branch: master
Gerrit-Owner: Hashar <has...@free.fr>
Gerrit-Reviewer: Hashar <has...@free.fr>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to