From 966a4f57d31c491b6194514f57008c20411d18fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Thu, 15 Dec 2011 17:14:55 +0100 Subject: [PATCH] Finally fixing ChatPageMenuItemProvider --- .../menu/page/ChatPageMenuItemProvider.class.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/file/lib/system/menu/page/ChatPageMenuItemProvider.class.php b/file/lib/system/menu/page/ChatPageMenuItemProvider.class.php index 93d0c37..3f44ff4 100644 --- a/file/lib/system/menu/page/ChatPageMenuItemProvider.class.php +++ b/file/lib/system/menu/page/ChatPageMenuItemProvider.class.php @@ -24,7 +24,9 @@ public function isVisible() { if (!\wcf\system\WCF::getUser()->userID) return false; try { - ChatRoom::getCache()->seek(0); + $cache = ChatRoom::getCache(); + $cache->seek(0); + $this->room = $cache->search($cache->key()); return true; } catch (\OutOfBoundsException $e) { @@ -38,9 +40,8 @@ public function isVisible() { * @see \wcf\system\menu\page\PageMenuItemProvider::getLink() */ public function getLink() { - if (!$this->isVisible()) return parent::getLink(); - return \wcf\util\HeaderUtil::redirect(\wcf\system\request\LinkHandler::getInstance()->getLink('Chat', array( - 'object' => ChatRoom::getCache()->search(ChatRoom::getCache()->key()) - ))); + return \wcf\system\request\LinkHandler::getInstance()->getLink('Chat', array( + 'object' => $this->room + )); } }