When in the admin section of the site, the main "Administer" link of the breadcrumb gets removed when using this module. This happens when the option is checked "Use menu the page belongs to for the breadcrumb" at admin/settings/menu_breadcrumb.

The attached patch addresses this by checking to see if the current path is in the admin section of the site before adjusting the menu. it amounts to wrapping an "if" around the meat of the menu_breadcrumb_init() function. (The patch is longer because of the extra tabbing. There are actually only two new lines.)

Here is the entire updated function...

function menu_breadcrumb_init() {
  if (arg(0) != 'admin') {
    if (variable_get('menu_breadcrumb_determine_menu', 1)) {
      $menu_item = menu_get_item();
      $menu_link = menu_link_load(db_result(db_query("SELECT mlid FROM {menu_links} WHERE link_path = '%s'", $menu_item['href'])));
      $use_menu = $menu_link['menu_name'];
      menu_set_active_menu_name($use_menu);
    }

    $breadcrumb = drupal_get_breadcrumb();
  
    if (variable_get('menu_breadcrumb_append_node_title', 0) == 1) {
      if (variable_get('menu_breadcrumb_append_node_url', 0) == 1) {
        $breadcrumb[] = l(drupal_get_title(), $_GET['q']);
      }
      else {
        $breadcrumb[] = drupal_get_title();
      }
    }
    
    if (count($breadcrumb) == 1 && variable_get('menu_breadcrumb_hide_on_single_item', 0)) {
      $breadcrumb = array();
    }
    
    drupal_set_breadcrumb($breadcrumb);
  }
}
CommentFileSizeAuthor
admin_001.patch1.89 KBnadavoid
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

xurizaemon’s picture

Issue summary: View changes
Status: Needs review » Closed (outdated)

Cleaning up issue queue. Closing all D6 issues.

If you believe this issue still applies to a supported version, feel free to re-open it. That would be a great time to check if the issue contains clear steps for reproducing the bug!

Thanks and sorry for any inconvenience.