From a2ff23310c90757dc58b085a060d085ce0114ecc Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Tue, 13 Aug 2013 18:29:25 -0700 Subject: [PATCH] CRM_Event_Page_ManageEvent - Fix static warning Also: Preventively fix bad cache logic --- CRM/Event/Page/ManageEvent.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/CRM/Event/Page/ManageEvent.php b/CRM/Event/Page/ManageEvent.php index 6663905fff..47733b4888 100644 --- a/CRM/Event/Page/ManageEvent.php +++ b/CRM/Event/Page/ManageEvent.php @@ -104,9 +104,13 @@ class CRM_Event_Page_ManageEvent extends CRM_Core_Page { * * @return array (reference) of tab links */ - function &tabs($enableCart) { + static function &tabs($enableCart) { + $cacheKey = $enableCart ? 1 : 0; if (!(self::$_tabLinks)) { - self::$_tabLinks = array( + self::$_tabLinks = array(); + } + if (!isset(self::$_tabLinks[$cacheKey])) { + self::$_tabLinks[$cacheKey] = array( 'settings' => array( 'title' => ts('Info and Settings'), 'url' => 'civicrm/event/manage/settings', @@ -151,11 +155,11 @@ class CRM_Event_Page_ManageEvent extends CRM_Core_Page { } if (!$enableCart) { - unset(self::$_tabLinks['conference']); + unset(self::$_tabLinks[$cacheKey]['conference']); } - CRM_Utils_Hook::tabset('civicrm/event/manage', self::$_tabLinks, array()); - return self::$_tabLinks; + CRM_Utils_Hook::tabset('civicrm/event/manage', self::$_tabLinks[$cacheKey], array()); + return self::$_tabLinks[$cacheKey]; } /** -- 2.25.1