From: Aaron Schulz Date: Wed, 6 Feb 2019 20:38:18 +0000 (-0800) Subject: Make invalidateModuleCache() take a database domain ID X-Git-Tag: 1.34.0-rc.0~2913^2 X-Git-Url: http://git.cyclocoop.org/data/File:Image2.gif?a=commitdiff_plain;h=633be72f6f0f57741b55c46eda6b5673a6894a71;p=lhc%2Fweb%2Fwiklou.git Make invalidateModuleCache() take a database domain ID Change-Id: I5d9880a5aee4b055365549671258eb9f242a37d6 --- 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 ); } }