diff --git a/includes/menu.inc b/includes/menu.inc index ca37ba509dc..2b489d88645 100644 --- a/includes/menu.inc +++ b/includes/menu.inc @@ -2483,6 +2483,9 @@ function menu_link_get_preferred($path = NULL, $selected_menu = NULL) { // untranslated paths). Afterwards, the most relevant path is picked from // the menus, ordered by menu preference. $item = menu_get_item($path); + if ($item === FALSE) { + return FALSE; + } $path_candidates = array(); // 1. The current item href. $path_candidates[$item['href']] = $item['href']; diff --git a/modules/block/block.module b/modules/block/block.module index d68ea9e7a9a..a482d261269 100644 --- a/modules/block/block.module +++ b/modules/block/block.module @@ -263,7 +263,7 @@ function block_page_build(&$page) { $all_regions = system_region_list($theme); $item = menu_get_item(); - if ($item['path'] != 'admin/structure/block/demo/' . $theme) { + if ($item === FALSE || $item['path'] != 'admin/structure/block/demo/' . $theme) { // Load all region content assigned via blocks. foreach (array_keys($all_regions) as $region) { // Assign blocks to region. @@ -283,7 +283,6 @@ function block_page_build(&$page) { } else { // Append region description if we are rendering the regions demo page. - $item = menu_get_item(); if ($item['path'] == 'admin/structure/block/demo/' . $theme) { foreach (system_region_list($theme, REGIONS_VISIBLE, FALSE) as $region) { $description = '