diff --git a/hansel.actions.inc b/hansel.actions.inc index 97031ec8369bca1983d2b6b100f0e5dbcafe7d01..bcd229a707a71a5734b8a7997dce83f599125e6e 100644 --- a/hansel.actions.inc +++ b/hansel.actions.inc @@ -282,21 +282,19 @@ function menu_hansel_get_parent($path) { function path_hansel_get_parent($path) { if (variable_get('hansel_parent_lookup_paths', TRUE)) { $alias = drupal_get_path_alias($_GET['q']); - if ($alias != $_GET['q']) { - $alias = substr($alias, 0, strrpos($alias, '/')); - if (!($path = drupal_lookup_path($alias))) { - // The alias is probably a valid system path. - $path = $alias; - } - if (!$parent_path = drupal_lookup_path($path)) { - $parent_path = $path; - } - if ($item = menu_get_item($parent_path)) { - return array( - 'path' => $parent_path, - 'title' => $item['title'], - ); - } + $alias = substr($alias, 0, strrpos($alias, '/')); + if (!($path = drupal_lookup_path($alias))) { + // The alias is probably a valid system path. + $path = $alias; + } + if (!$parent_path = drupal_lookup_path($path)) { + $parent_path = $path; + } + if ($item = menu_get_item($parent_path)) { + return array( + 'path' => $parent_path, + 'title' => $item['title'], + ); } } return FALSE;