Merge "RCFilters: Trim spaces in saved query names"
[lhc/web/wiklou.git] / includes / resourceloader / ResourceLoaderClientHtml.php
index ef2827c..ace8f41 100644 (file)
@@ -170,15 +170,16 @@ class ResourceLoaderClientHtml {
 
                        if ( $module->getType() !== ResourceLoaderModule::LOAD_STYLES ) {
                                $logger = $rl->getLogger();
-                               $logger->debug( 'Unexpected general module "{module}" in styles queue.', [
+                               $logger->error( 'Unexpected general module "{module}" in styles queue.', [
                                        'module' => $name,
                                ] );
-                       } else {
-                               // Stylesheet doesn't trigger mw.loader callback.
-                               // Set "ready" state to allow dependencies and avoid duplicate requests. (T87871)
-                               $data['states'][$name] = 'ready';
+                               continue;
                        }
 
+                       // Stylesheet doesn't trigger mw.loader callback.
+                       // Set "ready" state to allow dependencies and avoid duplicate requests. (T87871)
+                       $data['states'][$name] = 'ready';
+
                        $group = $module->getGroup();
                        $context = $this->getContext( $group, ResourceLoaderModule::TYPE_STYLES );
                        if ( $module->isKnownEmpty( $context ) ) {
@@ -365,7 +366,11 @@ class ResourceLoaderClientHtml {
                $rl = $mainContext->getResourceLoader();
                $chunks = [];
 
+               // Sort module names so requests are more uniform
+               sort( $modules );
+
                if ( $mainContext->getDebug() && count( $modules ) > 1 ) {
+
                        $chunks = [];
                        // Recursively call us for every item
                        foreach ( $modules as $name ) {
@@ -374,8 +379,6 @@ class ResourceLoaderClientHtml {
                        return new WrappedStringList( "\n", $chunks );
                }
 
-               // Sort module names so requests are more uniform
-               sort( $modules );
                // Create keyed-by-source and then keyed-by-group list of module objects from modules list
                $sortedModules = [];
                foreach ( $modules as $name ) {
@@ -415,7 +418,7 @@ class ResourceLoaderClientHtml {
                                // Special handling for the user group; because users might change their stuff
                                // on-wiki like user pages, or user preferences; we need to find the highest
                                // timestamp of these user-changeable modules so we can ensure cache misses on change
-                               // This should NOT be done for the site group (bug 27564) because anons get that too
+                               // This should NOT be done for the site group (T29564) because anons get that too
                                // and we shouldn't be putting timestamps in CDN-cached HTML
                                if ( $group === 'user' ) {
                                        // Must setModules() before makeVersionQuery()