Fix regression in r70657. Misplaced else condition was causing cache misses
authorNiklas Laxström <nikerabbit@users.mediawiki.org>
Fri, 10 Dec 2010 13:18:11 +0000 (13:18 +0000)
committerNiklas Laxström <nikerabbit@users.mediawiki.org>
Fri, 10 Dec 2010 13:18:11 +0000 (13:18 +0000)
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

index b518e3c..1cccf78 100644 (file)
@@ -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;
                        }
                }