Quick fix: revert cached sidebar
authorBrion Vibber <brion@users.mediawiki.org>
Sat, 14 Jan 2006 17:09:32 +0000 (17:09 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Sat, 14 Jan 2006 17:09:32 +0000 (17:09 +0000)
Breaks badly due to user language selection

includes/MessageCache.php
includes/Skin.php

index c6c56ab..de8fd95 100755 (executable)
@@ -289,11 +289,10 @@ class MessageCache {
        }
 
        function replace( $title, $text ) {
-               global $wgLocalMessageCache, $parserMemc, $wgDBname;
+               global $wgLocalMessageCache;
 
                $this->lock();
                $this->load();
-               $parserMemc->delete("$wgDBname:sidebar");
                if ( is_array( $this->mCache ) ) {
                        $this->mCache[$title] = $text;
                        $this->mMemc->set( $this->mMemcKey, $this->mCache, $this->mExpiry );
index 0dd3077..532a7bf 100644 (file)
@@ -1393,16 +1393,11 @@ END;
         * @access private
         */
        function buildSidebar() {
-               global $wgTitle, $action, $wgDBname, $parserMemc;
+               global $wgTitle, $action;
 
                $fname = 'SkinTemplate::buildSidebar';
-
+               $pageurl = $wgTitle->getLocalURL();
                wfProfileIn( $fname );
-               $cachedsidebar=$parserMemc->get("{$wgDBname}:sidebar");
-               if ($cachedsidebar!="") {
-                       wfProfileOut($fname);
-                       return $cachedsidebar;
-               }
 
                $bar = array();
                $lines = explode( "\n", wfMsgForContent( 'sidebar' ) );
@@ -1427,13 +1422,12 @@ END;
                                                'text' => $text,
                                                'href' => $href,
                                                'id' => 'n-' . strtr($line[1], ' ', '-'),
-                                               'active' => false
+                                               'active' => $pageurl == $href
                                        );
                                } else { continue; }
                        }
                }
 
-               $cachednotice=$parserMemc->set("{$wgDBname}:sidebar",$bar,86400);
                wfProfileOut( $fname );
                return $bar;
        }