When using crumbs.path plugin for path having alias like "a/b/c" breadcrumb looks like "Home>c".
The problem that crumbs module tries to load parent path menu item for "a/b" using menu_get_item() function and fails as it works with interal drupal paths only, not aliased. Module counts "a/b" path as non-existing and stops building breadcrumbs.
I propose to modify crumbs.path plugin to return internal parent path.
class path_class_CrumbsParentFinder {
function getRuleTitle() {
return 'existing alias for the given path';
}
function find($path) {
$alias = drupal_get_path_alias($path);
$fragments = explode('/', $alias);
if (count($fragments) > 1) {
array_pop($fragments);
return drupal_get_normal_path(implode('/', $fragments));
}
}
}
Comments
Comment #1
donquixote commentedLooks reasonable.
The other option would be to always call drupal_get_normal_path on any path returned from the find() hook.
I think I even ran into this same issue myself, and fixed it on a local version, but not in a way that I want to commit it. Probably in the following weeks I will have time to make a new -unstable release. No access to code atm.
I wonder if I can make unstables with two-digit version numbers :)
Until then I think your patch/fix is a good solution.
Comment #2
donquixote commentedFixed in -dev (wait for packaging script).
Comment #3
donquixote commented