Jdlrobson has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/94171


Change subject: Make debug=true work again
......................................................................

Make debug=true work again

Rejoice as QUnit tests in debug pass again

Bug: 56153
Change-Id: I58da7e37e35aa60650d92614f0696d443c9120d4
---
M includes/modules/MFResourceLoaderModule.php
1 file changed, 27 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend 
refs/changes/71/94171/1

diff --git a/includes/modules/MFResourceLoaderModule.php 
b/includes/modules/MFResourceLoaderModule.php
index 849502c..35890af 100644
--- a/includes/modules/MFResourceLoaderModule.php
+++ b/includes/modules/MFResourceLoaderModule.php
@@ -129,11 +129,6 @@
                return $this->messages;
        }
 
-       public function supportsURLLoading() {
-               // When templates or parsed messages are present in the module 
force load.php urls
-               return $this->hasTemplates || $this->hasParsedMessages ? false 
: true;
-       }
-
        /**
         * Gets all scripts for a given context concatenated together including 
processed messages
         *
@@ -146,6 +141,33 @@
        }
 
        /**
+        * @param ResourceLoaderContext $context
+        * @return array
+        */
+       public function getScriptURLsForDebug( ResourceLoaderContext $context ) 
{
+               if ( $this->hasParsedMessages || $this->hasTemplates ) {
+                       $urls = array(
+                               ResourceLoader::makeLoaderURL(
+                                       array( $this->getName() ),
+                                       $context->getLanguage(),
+                                       $context->getSkin(),
+                                       $context->getUser(),
+                                       $context->getVersion(),
+                                       true, // debug
+                                       // FIXME: Make this templates and 
update makeModuleResponse so that it only outputs template code
+                                       // When this is done you can merge with 
parent array and retain file names
+                                       'scripts', // only
+                                       $context->getRequest()->getBool( 
'printable' ),
+                                       $context->getRequest()->getBool( 
'handheld' )
+                               ),
+                       );
+               } else {
+                       $urls = parent::getScriptURLsForDebug( $context );
+               }
+               return $urls;
+       }
+
+       /**
         * Checks whether any resources used by module have changed
         *
         * @param $context ResourceLoaderContext: Context in which to generate 
script

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I58da7e37e35aa60650d92614f0696d443c9120d4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to