Ejegg has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/316394

Change subject: getMsgFromNamespace uses Revision::READ_LATEST
......................................................................

getMsgFromNamespace uses Revision::READ_LATEST

We're going to cache the result whether or not the revision is found,
so we want to make sure we're not storing anything stale.

Bug: T144952
Change-Id: Ifdb1b9fb51e461caadb64f670ae544bab2a1f12f
---
M includes/cache/MessageCache.php
1 file changed, 5 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/94/316394/1

diff --git a/includes/cache/MessageCache.php b/includes/cache/MessageCache.php
index 6834ac0..58c398d 100644
--- a/includes/cache/MessageCache.php
+++ b/includes/cache/MessageCache.php
@@ -966,8 +966,11 @@
                        }
                }
 
-               # Try loading it from the database
-               $revision = Revision::newFromTitle( Title::makeTitle( 
NS_MEDIAWIKI, $title ) );
+               # Try loading it from the database. Use READ_LATEST because we 
will
+               # cache both positive and negative results.
+               $revision = Revision::newFromTitle(
+                       Title::makeTitle( NS_MEDIAWIKI, $title ), 0, 
Revision::READ_LATEST
+               );
                if ( $revision ) {
                        $content = $revision->getContent();
                        if ( !$content ) {

-- 
To view, visit https://gerrit.wikimedia.org/r/316394
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifdb1b9fb51e461caadb64f670ae544bab2a1f12f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Ejegg <eeggles...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to