From a5670d8d708c35589a695640694199c7b026877b Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sat, 30 May 2009 17:14:17 -0700 Subject: gate $can_edit and $can_add on whether or not we have an $item at all (fixes a bug where search doesn't render because it has no item). --- modules/gallery/helpers/gallery_menu.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'modules') diff --git a/modules/gallery/helpers/gallery_menu.php b/modules/gallery/helpers/gallery_menu.php index 0f0e676d..09c2d91a 100644 --- a/modules/gallery/helpers/gallery_menu.php +++ b/modules/gallery/helpers/gallery_menu.php @@ -28,8 +28,8 @@ class gallery_menu_Core { $item = $theme->item(); - $can_edit = access::can("edit", $item) || $is_admin; - $can_add = access::can("add", $item) || $is_admin; + $can_edit = $item && access::can("edit", $item) || $is_admin; + $can_add = $item && (access::can("add", $item) || $is_admin); if ($item && $can_edit || $can_add) { $menu->append($options_menu = Menu::factory("submenu") -- cgit v1.2.3