drupal 7.14
the problem is that menu icons are being added to the breadcrumbs.
I have a menu which some entries have image icons, and when I am on the content page for that specific menu entry it also adds the image and the class "menu_icon" to its breadcrumb entry.
One weird thing is, the menu is as follows
parent
---child1
------sub-child1
------sub-child2
---child2
the icons are on the child1 and child2 level and the sub-childs have no icons.
if i navigate to the first level child , lets say child 1, the breadcrumb is fine.
But if a navigate to the second level child, sub-child1, than the image and class is added to child1.
And I don't know if it matters but i am also using menu block split module, but I have disabled it and has made no difference.

Comments

hwasem’s picture

Did you ever find a solution for this problem?

I'm developing a relatively small mobile site and I just discovered this issue. I am seeing my menu icon in the breadcrumb of my third level Branch page. I use menu icons on the second level menus (Calendar and Branches).

I'm using Drupal 7.15 with a sub-theme of Sky Adaptive Themes (7.x-3.0). I'm using Menu Icons 7.x-3.0 beta3.

If I switch to Bartik, remove my custom breadcrumb theming in template.php and turn off custom breadcrumb module, it still appears in the breadcrumbs of my individual branch pages.

Here is an outline of where I am seeing it:

Home
Calendar
Event 1
Event 2
Branches
Branch 1 - displays menu icon in breadcrumbs for "Branches"
Branch 2 - displays menu icon in breadcrumbs for "Branches"

Interestingly, the Calendar menu in which I am using Custom Breadcrumbs on does not show the icon (or menu-icon CSS tags). I was using Custom Breadcrumbs to provide a breadcrumb for the Event pages being imported via Feeds. They have no breadcrumb without the Custom Breadcrumb module turned on.

I saw another issue that is the same, but it was closed without replication information - http://drupal.org/node/1240052.

At this point I think I can use CSS to remove the menu icon, but it would be better if I could remove it programatically. If I develop this site into something larger, it will become a much bigger issue.

Thanks for your help!

omerida’s picture

I used hook_menu_breadcrumb_alter() to remove the menu icon related classes from the breadcrumb display.

/**
 * Implements hook_menu_breadcrumb_alter()
 *
 * @param $active_trail
 * @param $item
 */
function mytheme_menu_breadcrumb_alter(&$active_trail, $item) {
  foreach ($active_trail as &$crumb) {
    if (isset($crumb['localized_options']['attributes']['class'])) {
      $crumb['localized_options']['attributes']['class'] = array_filter(
        $crumb['localized_options']['attributes']['class'],
        function ($class) {
          if ('menu_icon' == $class || preg_match('/^menu\-[0-9]+$/', $class)) {
            // remove class
            return false;
          }

          // keep it
          return true;
        }
      ) ;
    }
  }
}
acrollet’s picture

Status: Active » Fixed

Thanks much for the bug report, I committed the code in #2 with minor modifications: http://drupalcode.org/project/menu_icons.git/commit/e6cac67

Status: Fixed » Closed (fixed)

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

Anonymous’s picture

Issue summary: View changes

fixed typos