summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2009-05-30 17:14:17 -0700
committerBharat Mediratta <bharat@menalto.com>2009-05-30 17:14:17 -0700
commita5670d8d708c35589a695640694199c7b026877b (patch)
tree65237ec9c88cfc4caeca2ebeaa73774ddc39503f
parent3b3531cbb834c192339292df8ab3e9220a48d924 (diff)
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).
-rw-r--r--modules/gallery/helpers/gallery_menu.php4
1 files changed, 2 insertions, 2 deletions
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")