Loading hansel.actions.inc +9 −3 Original line number Diff line number Diff line Loading @@ -208,7 +208,7 @@ function hansel_action_add_parents_get_crumbs($arguments) { } $crumbs = array(); $parent_paths = array(); $parent_hashes = array(); $modules = module_implements('hansel_get_parent'); Loading @@ -216,11 +216,17 @@ function hansel_action_add_parents_get_crumbs($arguments) { foreach ($modules as $module) { $hook = "{$module}_hansel_get_parent"; if ($parent = $hook($path)) { if (in_array($parent['path'], $parent_paths)) { // Create a hash to check recursion. The reason that we do not simply // check the paths is that the site structure may not be hierarchical. // There could be a parent item with the same path. This is often used // in cases where a top level item item has the same link as its first // child item. $hash = crc32($parent['path'] . $parent['title']); if (in_array($hash, $parent_hashes)) { // We are in recursion. break(2); } $parent_paths[] = $parent['path']; $parent_hashes[] = $hash; array_unshift($crumbs, array( 'title' => $parent['title'], 'href' => $parent['path'], Loading Loading
hansel.actions.inc +9 −3 Original line number Diff line number Diff line Loading @@ -208,7 +208,7 @@ function hansel_action_add_parents_get_crumbs($arguments) { } $crumbs = array(); $parent_paths = array(); $parent_hashes = array(); $modules = module_implements('hansel_get_parent'); Loading @@ -216,11 +216,17 @@ function hansel_action_add_parents_get_crumbs($arguments) { foreach ($modules as $module) { $hook = "{$module}_hansel_get_parent"; if ($parent = $hook($path)) { if (in_array($parent['path'], $parent_paths)) { // Create a hash to check recursion. The reason that we do not simply // check the paths is that the site structure may not be hierarchical. // There could be a parent item with the same path. This is often used // in cases where a top level item item has the same link as its first // child item. $hash = crc32($parent['path'] . $parent['title']); if (in_array($hash, $parent_hashes)) { // We are in recursion. break(2); } $parent_paths[] = $parent['path']; $parent_hashes[] = $hash; array_unshift($crumbs, array( 'title' => $parent['title'], 'href' => $parent['path'], Loading