From: Niklas Laxström Date: Fri, 10 Dec 2010 13:18:11 +0000 (+0000) Subject: Fix regression in r70657. Misplaced else condition was causing cache misses X-Git-Tag: 1.31.0-rc.0~33399 X-Git-Url: http://git.cyclocoop.org/%22%2C%20generer_url_ecrire%28?a=commitdiff_plain;h=2a66100694fb458261619fa1961956461a5926c5;p=lhc%2Fweb%2Fwiklou.git 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. --- 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; } }