Merge "ForeignStructuredUpload.BookletLayout: Add direct dependency on 'moment'"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Tue, 17 Nov 2015 23:49:42 +0000 (23:49 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Tue, 17 Nov 2015 23:49:42 +0000 (23:49 +0000)
includes/resourceloader/ResourceLoaderContext.php
resources/Resources.php
resources/src/mediawiki.action/mediawiki.action.edit.preview.js
tests/phpunit/includes/resourceloader/DerivativeResourceLoaderContextTest.php

index 6ecee4c..ff0e449 100644 (file)
@@ -33,19 +33,24 @@ class ResourceLoaderContext {
 
        protected $resourceLoader;
        protected $request;
-       protected $modules;
-       protected $language;
-       protected $direction;
+
+       // Module content vary
        protected $skin;
-       protected $user;
+       protected $language;
        protected $debug;
+       protected $user;
+
+       // Request vary (in addition to cache vary)
+       protected $modules;
        protected $only;
        protected $version;
-       protected $hash;
        protected $raw;
        protected $image;
        protected $variant;
        protected $format;
+
+       protected $direction;
+       protected $hash;
        protected $userObj;
        protected $imageObj;
 
@@ -346,9 +351,18 @@ class ResourceLoaderContext {
        public function getHash() {
                if ( !isset( $this->hash ) ) {
                        $this->hash = implode( '|', array(
-                               $this->getLanguage(), $this->getSkin(), $this->getUser(),
-                               $this->getImage(), $this->getVariant(), $this->getFormat(),
-                               $this->getDebug(), $this->getOnly(), $this->getVersion()
+                               // Module content vary
+                               $this->getLanguage(),
+                               $this->getSkin(),
+                               $this->getDebug(),
+                               $this->getUser(),
+                               // Request vary
+                               $this->getOnly(),
+                               $this->getVersion(),
+                               $this->getRaw(),
+                               $this->getImage(),
+                               $this->getVariant(),
+                               $this->getFormat(),
                        ) );
                }
                return $this->hash;
index e39db33..b8abff3 100644 (file)
@@ -1370,7 +1370,6 @@ return array(
                        'editingsection',
                        'pagetitle',
                        'otherlanguages',
-                       'tooltip-p-lang',
                        'summary-preview',
                        'subject-preview',
                        'parentheses',
index 125b1b3..5cd4a7e 100644 (file)
                                        'class': 'portal',
                                        id: 'p-lang',
                                        role: 'navigation',
-                                       title: mw.msg( 'tooltip-p-lang' ),
                                        'aria-labelledby': 'p-lang-label'
                                } )
                                .append( $( '<h3>' ).attr( 'id', 'p-lang-label' ).text( mw.msg( 'otherlanguages' ) ) )
index b457cec..24ea4b2 100644 (file)
@@ -25,7 +25,7 @@ class DerivativeResourceLoaderContextTest extends PHPUnit_Framework_TestCase {
                $this->assertEquals( $derived->getModules(), array( 'test.context' ) );
                $this->assertEquals( $derived->getOnly(), 'scripts' );
                $this->assertEquals( $derived->getSkin(), 'fallback' );
-               $this->assertEquals( $derived->getHash(), 'zh|fallback||||||scripts|' );
+               $this->assertEquals( $derived->getHash(), 'zh|fallback|||scripts|||||' );
        }
 
        public function testSetLanguage() {
@@ -72,7 +72,7 @@ class DerivativeResourceLoaderContextTest extends PHPUnit_Framework_TestCase {
 
                $derived->setLanguage( 'nl' );
                // Assert that subclass is able to clear parent class "hash" member
-               $this->assertEquals( $derived->getHash(), 'nl|fallback||||||scripts|' );
+               $this->assertEquals( $derived->getHash(), 'nl|fallback|||scripts|||||' );
        }
 
 }