Merge "resourceloader: Restrict addModuleStyles() to type=styles modules"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Fri, 30 Jun 2017 01:53:26 +0000 (01:53 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Fri, 30 Jun 2017 01:53:26 +0000 (01:53 +0000)
includes/resourceloader/ResourceLoaderClientHtml.php
tests/phpunit/includes/resourceloader/ResourceLoaderClientHtmlTest.php

index b8f2fa5..ace8f41 100644 (file)
@@ -170,15 +170,16 @@ class ResourceLoaderClientHtml {
 
                        if ( $module->getType() !== ResourceLoaderModule::LOAD_STYLES ) {
                                $logger = $rl->getLogger();
-                               $logger->warning( '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 ) ) {
index 979da44..3e0d883 100644 (file)
@@ -134,7 +134,6 @@ class ResourceLoaderClientHtmlTest extends PHPUnit_Framework_TestCase {
                                'test.top',
                        ],
                        'styles' => [
-                               'test.styles.mixed',
                                'test.styles.pure',
                        ],
                        'scripts' => [