Make invalidateModuleCache() take a database domain ID
authorAaron Schulz <aschulz@wikimedia.org>
Wed, 6 Feb 2019 20:38:18 +0000 (12:38 -0800)
committerAaron Schulz <aschulz@wikimedia.org>
Wed, 6 Feb 2019 20:40:11 +0000 (12:40 -0800)
Change-Id: I5d9880a5aee4b055365549671258eb9f242a37d6

includes/page/WikiPage.php
includes/resourceloader/ResourceLoaderWikiModule.php

index add76db..6217ee7 100644 (file)
@@ -3033,7 +3033,10 @@ class WikiPage implements Page, IDBAccessObject {
                // Clear caches
                self::onArticleDelete( $this->mTitle );
                ResourceLoaderWikiModule::invalidateModuleCache(
-                       $this->mTitle, $revision, null, wfWikiID()
+                       $this->mTitle,
+                       $revision,
+                       null,
+                       WikiMap::getCurrentWikiDbDomain()->getId()
                );
 
                // Reset this object and the Title object
index fe77576..ecb1a09 100644 (file)
@@ -528,15 +528,15 @@ class ResourceLoaderWikiModule extends ResourceLoaderModule {
         * @param Title $title
         * @param Revision|null $old Prior page revision
         * @param Revision|null $new New page revision
-        * @param string $wikiId
+        * @param string $domain Database domain ID
         * @since 1.28
         */
        public static function invalidateModuleCache(
-               Title $title, Revision $old = null, Revision $new = null, $wikiId
+               Title $title, Revision $old = null, Revision $new = null, $domain
        ) {
                static $formats = [ CONTENT_FORMAT_CSS, CONTENT_FORMAT_JAVASCRIPT ];
 
-               Assert::parameterType( 'string', $wikiId, '$wikiId' );
+               Assert::parameterType( 'string', $domain, '$domain' );
 
                // TODO: MCR: differentiate between page functionality and content model!
                //       Not all pages containing CSS or JS have to be modules! [PageType]
@@ -550,7 +550,7 @@ class ResourceLoaderWikiModule extends ResourceLoaderModule {
 
                if ( $purge ) {
                        $cache = ObjectCache::getMainWANInstance();
-                       $key = $cache->makeGlobalKey( 'resourceloader', 'titleinfo', $wikiId );
+                       $key = $cache->makeGlobalKey( 'resourceloader', 'titleinfo', $domain );
                        $cache->touchCheckKey( $key );
                }
        }