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

fago’s picture

Component: User Interface » User interface

right. 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.

avpaderno’s picture

In 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.

avpaderno’s picture

Taking 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".

avpaderno’s picture

I 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:

  foreach (module_implements('search') as $name) {
    $items['search/'. $name .'/%menu_tail'] = array(
      'title callback' => 'module_invoke',
      'title arguments' => array($name, 'search', 'name', TRUE),
      'page callback' => 'search_view',
      'page arguments' => array($name),
      'access callback' => '_search_menu',
      'access arguments' => array($name),
      'type' => MENU_LOCAL_TASK,
      'parent' => 'search',
      'file' => 'search.pages.inc',
    );
  }

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.

fago’s picture

I'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.

mitchell’s picture

fago’s picture

fago’s picture

Version: 6.x-1.0-beta1 » 6.x-1.x-dev
Issue tags: +rules 1.0

When the core issue is fixed, the rules breadcrumb should work fine in 1.0.

fago’s picture

ok, I've added a workaround, which should improve the current situation. It's not yet perfect though.

fago’s picture

Status: Active » Fixed

ok, 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.

Status: Fixed » Closed (fixed)
Issue tags: -rules 1.0

Automatically closed -- issue fixed for 2 weeks with no activity.