I realize that 7.x-1.0-alpha1 is a bit out of date, but it's what we've got.

We've been running into a problem recently where the incorrect breadcrumb is appearing on pages. Typically, this is occurring on either a node page that has been heavily modified with multiple views that show related nodes of different types, or on view pages themselves (that don't have breadcrumbs set) that again contain some reference links to other node types.

I dug through the code a bit and the culprit seems to be that the custom_breadcrumbs_node_view function is receiving incorrect $node objects from... someplace. I'm not sure exactly where. It could be Views, it could be the Flag module.

I've put a bandaid on the issue to resolve it for my own purposes, but I thought I should post in case others are having similar issues (I couldn't find anything on this topic during my searches) or in case there is a better solution floating around (other than 'just upgrade').

Basically, I wrap the entire functionality of the _node_view function in a verification that the path of the $node object actually matches the page that we are currently viewing.

function custom_breadcrumbs_node_view($node, $build_mode) {
  //Patching to correct issue with custom breadcrumb appearing on incorrect node type view pages
  $currentLink = current_path();
  $itemLink = drupal_lookup_path('alias',"node/".$node->nid);
  if ($currentLink == $itemLink || $currentLink == "node/" . $node->nid) {
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mikemadison’s picture

Harshendra Baghel’s picture

I Have facing an issue regarding easy breadcrumb module i have installed it. But it's not displaying properly some menus showing but some menus is not displaying properly. The by default theme is Bartic.

In Home Page /Front Page Displaying

Home/Home --------Incorrect

TV Shows Menu its displaying Correct

Home/Tv Shows ------Correct

Users Menu its displaying correct

Home/Users

Survey Results menu parent menu displaying correct
Home / Survey Results----Correct

Under Survey Results a list of no's of surveys which is related to TV Episodes Survey results list of 2, 3, 5, 10, 20 minutes survey graph which is used Google Charts API.

When we have clicked any survey graph results like "testinggraph-5min", testinggraph-3min" Its not displaying Breadcrumb

Its displaying only

Home/ /

Home/ / /

The Epected Breadcrumb Should be:

Home/Survey Results/Survey Graph/Testinggraph 5min ...Epected

Home/Survey Results/Graph/ Testinggraph-3min.... Expected

[1]: https://i.stack.imgur.com/WiW45.png
[2]: https://i.stack.imgur.com/NYExp.png
[3]: https://i.stack.imgur.com/Ei6cU.png
[4]: https://i.stack.imgur.com/peMdS.png
[5]: https://i.stack.imgur.com/MdYYd.png
[6]: https://i.stack.imgur.com/ZhPXz.png

lamp5’s picture

Status: Active » Closed (outdated)

Closing this because is outdated. Only 7.2 branch and greater are supported.