From 2a66100694fb458261619fa1961956461a5926c5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Niklas=20Laxstr=C3=B6m?= Date: Fri, 10 Dec 2010 13:18:11 +0000 Subject: [PATCH] Fix regression in r70657. Misplaced else condition was causing cache misses to try to load the message text and cache the result individually. However in the default configuration cache miss always means that the message doesn't exists in the database. --- includes/MessageCache.php | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/includes/MessageCache.php b/includes/MessageCache.php index b518e3cb04..1cccf78197 100644 --- a/includes/MessageCache.php +++ b/includes/MessageCache.php @@ -644,23 +644,22 @@ class MessageCache { return false; } elseif( $entry === '!TOO BIG' ) { // Fall through and try invididual message cache below + } + } else { + // XXX: This is not cached in process cache, should it? + $message = false; + wfRunHooks('MessagesPreLoad', array( $title, &$message ) ); + if ( $message !== false ) { + return $message; + } - } else { - // XXX: This is not cached in process cache, should it? - $message = false; - wfRunHooks('MessagesPreLoad', array( $title, &$message ) ); - if ( $message !== false ) { - return $message; - } - - /* If message cache is in normal mode, it is guaranteed - * (except bugs) that there is always entry (or placeholder) - * in the cache if message exists. Thus we can do minor - * performance improvement and return false early. - */ - if ( !$wgAdaptiveMessageCache ) { - return false; - } + /* If message cache is in normal mode, it is guaranteed + * (except bugs) that there is always entry (or placeholder) + * in the cache if message exists. Thus we can do minor + * performance improvement and return false early. + */ + if ( !$wgAdaptiveMessageCache ) { + return false; } } -- 2.20.1