When editing a rule, if you click on "Add a condition", or "Add an action" the breadcrumb passes from "Home › Administer › Rules › Triggered rules" to "Home". That is because the path passes (i.e.) from admin/rules/rules/rules_default_rule_1/edit to admin/rules/rules/rules_default_rule_1/add/condition/1; I think that the parent key used in the array defining the menu items could help in setting a better breadcrumb.
Comments
Comment #1
fagoright. It's on my todo list to further improve the breadcrumbs.
However as long the parent menu item fits, the breadcrumb should be automatically there I think. I'll have to look at it.
Comment #2
avpadernoIn the example I made, there is a match on the parent menu after tracing back three levels; maybe that is too far to be known as parent menu.
I am not sure of what I said about the parent key; I thought I read something, maybe in the source code, but I am not able to find any reference to that anymore.
Comment #3
avpadernoTaking as example a real case, Drupal core has a admin/settings/actions menu with "Home › Administer › Site configuration" like breadcrumb, and a admin/settings/actions/configure/b1500c08f3b29d92a795c5e60736b613 menu with "Home › Administer › Site configuration › Actions" like breadcrumb.
Looking at the definition of the menus given by system.module, the first menu matches the admin/settings/actions item in the array returned by
system_menu(), while the second one matches the admin/settings/actions/manage item.In the example I made when I opened this issue, maybe it's enough to change the menu to admin/rules/rules/rules_default_rule_1/edit/1/condition to avoid that the breadcrumb becomes "Home".
Comment #4
avpadernoI finally found out where I read of the parent key used in the array declaring the menu items.
The search.module uses the following code:
I don't have any reason to think this is a specific case valid for search.module, so I would think that is the way to have a coherent breadcrumb.
Comment #5
fagoI've tried adding it, but it doesn't help. Note that for the rule itself it's already manually fixed by rules_admin_fix_breadcrumb(). Anyway I don't know why not at least the rule is listed as parent - probably it needs a trail up to Home, but it ends at the rule edit page.
I've too look further into that when I've got the time.
Comment #6
mitchell commentedMarked #374698: breadcrumbs at the rule element edit screen missing as a duplicate of this issue.
Comment #7
fagoI tried to track it down -> see #430304: Menu item loses parents when parent is a router item only
Comment #8
fagoWhen the core issue is fixed, the rules breadcrumb should work fine in 1.0.
Comment #9
fagook, I've added a workaround, which should improve the current situation. It's not yet perfect though.
Comment #10
fagook, I had a short look at it again. I removed the previous workaround of manually adding breadcrumbs for "admin" and "admin/rules" - as people can move the menu out of the admin area. At least the other deeper breadcrumbs are still there then. For the others we have to wait for the core bugfix.