From 633be72f6f0f57741b55c46eda6b5673a6894a71 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Wed, 6 Feb 2019 12:38:18 -0800 Subject: [PATCH] Make invalidateModuleCache() take a database domain ID Change-Id: I5d9880a5aee4b055365549671258eb9f242a37d6 --- includes/page/WikiPage.php | 5 ++++- includes/resourceloader/ResourceLoaderWikiModule.php | 8 ++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/includes/page/WikiPage.php b/includes/page/WikiPage.php index add76db2c7..6217ee7e93 100644 --- a/includes/page/WikiPage.php +++ b/includes/page/WikiPage.php @@ -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 diff --git a/includes/resourceloader/ResourceLoaderWikiModule.php b/includes/resourceloader/ResourceLoaderWikiModule.php index fe77576ced..ecb1a09afa 100644 --- a/includes/resourceloader/ResourceLoaderWikiModule.php +++ b/includes/resourceloader/ResourceLoaderWikiModule.php @@ -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 ); } } -- 2.20.1