From: daniel Date: Fri, 3 Aug 2018 12:47:29 +0000 (+0200) Subject: Don't pass false as a wikiId to invalidateModuleCache() X-Git-Tag: 1.34.0-rc.0~4562^2 X-Git-Url: http://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=commitdiff_plain;h=c5deaec28cf0c17529feae5eec91c43f602e5eb2 Don't pass false as a wikiId to invalidateModuleCache() Using false to represent the local wiki is supported in many places in core, but not in invalidateModuleCache Bug: T199416 Change-Id: I5cb93c173295261bf5fcf6c77c197a80c4aac1a2 --- diff --git a/includes/Storage/DerivedPageDataUpdater.php b/includes/Storage/DerivedPageDataUpdater.php index 6f241bab6b..e353ab6c6e 100644 --- a/includes/Storage/DerivedPageDataUpdater.php +++ b/includes/Storage/DerivedPageDataUpdater.php @@ -1533,7 +1533,7 @@ class DerivedPageDataUpdater implements IDBAccessObject { // TODO: In the wiring, register a listener for this on the new PageEventEmitter ResourceLoaderWikiModule::invalidateModuleCache( - $title, $oldLegacyRevision, $legacyRevision, $this->getWikiId() + $title, $oldLegacyRevision, $legacyRevision, $this->getWikiId() ?: wfWikiID() ); $this->doTransition( 'done' ); diff --git a/includes/resourceloader/ResourceLoaderWikiModule.php b/includes/resourceloader/ResourceLoaderWikiModule.php index b699b366d1..fe77576ced 100644 --- a/includes/resourceloader/ResourceLoaderWikiModule.php +++ b/includes/resourceloader/ResourceLoaderWikiModule.php @@ -23,6 +23,7 @@ */ use MediaWiki\Linker\LinkTarget; +use Wikimedia\Assert\Assert; use Wikimedia\Rdbms\Database; use Wikimedia\Rdbms\IDatabase; @@ -535,6 +536,8 @@ class ResourceLoaderWikiModule extends ResourceLoaderModule { ) { static $formats = [ CONTENT_FORMAT_CSS, CONTENT_FORMAT_JAVASCRIPT ]; + Assert::parameterType( 'string', $wikiId, '$wikiId' ); + // TODO: MCR: differentiate between page functionality and content model! // Not all pages containing CSS or JS have to be modules! [PageType] if ( $old && in_array( $old->getContentFormat(), $formats ) ) {