Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Menu breadcrumb doesn't work on draft pages set by workbench_moderation module.
This results in inconsistent view of draft and published version of node.
Here is how active menu item is selected for breadcrumbs
$menu_item = menu_get_item();
$result = db_query("SELECT mlid, menu_name FROM {menu_links} WHERE link_path = :menu_item", array(':menu_item' => $menu_item['href']));
The problem is that $menu_item['href'] in our case = node/%nid/draft, and there is no menu_links.link_path = node/%nid/draft in database. We need to use $menu_item['tab_root_href'] or $menu_item['tab_parent_href'] instead (which is node/%nid) on draft pages.
Comment | File | Size | Author |
---|---|---|---|
#1 | menu_breadcrumb_breadcrumbs_on_draft_pages.patch | 1.68 KB | Andrei Tyuhai |
Comments
Comment #1
Andrei Tyuhai CreditAttribution: Andrei Tyuhai commentedComment #2
xurizaemonClosing a lot of ancient (> 4 years) issues. It's fine to re-open if you think there's something of value to be discussed.