Skip to content

Commit

Permalink
Use $theme->item() instead of $theme->item, otherwise
Browse files Browse the repository at this point in the history
isset($theme->item) may return true even when we don't have an actual
Item_Model in there.
  • Loading branch information
bharat committed Sep 12, 2010
1 parent c9c4f96 commit bfd92ac
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions modules/gallery/helpers/gallery_event.php
Expand Up @@ -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();
}
Expand Down

0 comments on commit bfd92ac

Please sign in to comment.