From ece1fbdc768b9d5d5bd54473b7968b89e8971d27 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Sat, 14 Jan 2006 17:09:32 +0000 Subject: [PATCH] Quick fix: revert cached sidebar Breaks badly due to user language selection --- includes/MessageCache.php | 3 +-- includes/Skin.php | 12 +++--------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/includes/MessageCache.php b/includes/MessageCache.php index c6c56abd57..de8fd95069 100755 --- a/includes/MessageCache.php +++ b/includes/MessageCache.php @@ -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 ); diff --git a/includes/Skin.php b/includes/Skin.php index 0dd307741c..532a7bf8aa 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -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; } -- 2.20.1