From cac26b713c5cdebd23d87355067b0d394bfa2fa5 Mon Sep 17 00:00:00 2001 From: Roan Kattouw Date: Mon, 15 Jul 2019 15:30:15 -0700 Subject: [PATCH] Remove $purgeBlobs parameter from LocalisationCacheRecache hook No longer allow hook functions to prevent message blobs from being purged. Pass in an always-true variable for backwards compatibility, which is then ignored. Change-Id: I27ac9599711f2f0df2514a3934270af0ce03da7f --- RELEASE-NOTES-1.34 | 2 ++ docs/hooks.txt | 2 -- includes/cache/localisation/LocalisationCache.php | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/RELEASE-NOTES-1.34 b/RELEASE-NOTES-1.34 index ea46a7d3a8..24809dd4ac 100644 --- a/RELEASE-NOTES-1.34 +++ b/RELEASE-NOTES-1.34 @@ -362,6 +362,8 @@ because of Phabricator reports. been deprecated. * User::getRights() and User::$mRights have been deprecated. Use PermissionManager::getUserPermissions() instead. +* The LocalisationCacheRecache hook no longer allows purging of message blobs + to be prevented. Modifying the $purgeBlobs parameter now has no effect. === Other changes in 1.34 === * … diff --git a/docs/hooks.txt b/docs/hooks.txt index 80453f48c6..3edd10d759 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -2087,8 +2087,6 @@ cache. $cache: The LocalisationCache object $code: language code &$alldata: The localisation data from core and extensions -&$purgeBlobs: whether to purge/update the message blobs via - MessageBlobStore::clear() 'LocalisationCacheRecacheFallback': Called for each language when merging fallback data into the cache. diff --git a/includes/cache/localisation/LocalisationCache.php b/includes/cache/localisation/LocalisationCache.php index c4a7e897c4..a0f3d8e28c 100644 --- a/includes/cache/localisation/LocalisationCache.php +++ b/includes/cache/localisation/LocalisationCache.php @@ -1004,8 +1004,8 @@ class LocalisationCache { $allData['list'][$key] = array_keys( $allData[$key] ); } # Run hooks - $purgeBlobs = true; - Hooks::run( 'LocalisationCacheRecache', [ $this, $code, &$allData, &$purgeBlobs ] ); + $unused = true; // Used to be $purgeBlobs, removed in 1.34 + Hooks::run( 'LocalisationCacheRecache', [ $this, $code, &$allData, &$unused ] ); if ( is_null( $allData['namespaceNames'] ) ) { throw new MWException( __METHOD__ . ': Localisation data failed sanity check! ' . @@ -1037,7 +1037,7 @@ class LocalisationCache { # Clear out the MessageBlobStore # HACK: If using a null (i.e. disabled) storage backend, we # can't write to the MessageBlobStore either - if ( $purgeBlobs && !$this->store instanceof LCStoreNull ) { + if ( !$this->store instanceof LCStoreNull ) { $blobStore = MediaWikiServices::getInstance()->getResourceLoader()->getMessageBlobStore(); $blobStore->clear(); } -- 2.20.1