From bfd92ac6f2d563106bc5906cc9fddb35bca44b58 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sat, 11 Sep 2010 21:38:38 -0700 Subject: [PATCH] Use $theme->item() instead of $theme->item, otherwise isset($theme->item) may return true even when we don't have an actual Item_Model in there. --- modules/gallery/helpers/gallery_event.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/gallery/helpers/gallery_event.php b/modules/gallery/helpers/gallery_event.php index 0ba980255c..81659b38c4 100644 --- a/modules/gallery/helpers/gallery_event.php +++ b/modules/gallery/helpers/gallery_event.php @@ -209,11 +209,12 @@ static function user_menu($menu, $theme) { ->url(user_profile::url($user->id)) ->label($user->display_name())); + $item = $theme->item(); if (Router::$controller == "admin") { $continue_url = url::abs_site(""); - } else if (isset($theme->item)) { + } else if ($item) { if (access::user_can(identity::guest(), "view", $theme->item)) { - $continue_url = $theme->item->abs_url(); + $continue_url = $item->abs_url(); } else { $continue_url = item::root()->abs_url(); }