If there is a view displayed in the content area of a node, the taxonomy breadcrumb module does not show the breadcrumb of the node which is displayed on the page but of the last node, which is in the view. It seems that the taxonomy_breadcrumb_nodeapi is executed not only for the node which is to show on the page but also for every node which is in the view.

To get this fixed I enhanced the first line of the taxonomy_breadcrumb_nodeapi to check, if the node being processed is the one in the url. So I changed

if ($op == 'view' && $a4 && !drupal_is_front_page()) {

to

if ($op == 'view' && $a4 && !drupal_is_front_page() && arg(1) == $node->nid) {

For me this works fine. But I would like to ask if this is the right place to fix this or if it wouldn't be better to do a change so that the taxonomy_breadcrumb_nodeapi is only called for the page but not for the nodes of the view and how this could be done.

Comments

_craig’s picture

Interesting solution. I like it.

_craig’s picture

Status: Active » Closed (fixed)
smitty’s picture

Status: Closed (fixed) » Postponed (maintainer needs more info)

Did you commit this to a new version (I could't find any)? Or ist there another solution to this problem?

Xano’s picture

Assigned: Unassigned » Xano

What about this?

if (arg(0) == 'node') {
// Do the move!
}

//edit: @ Smitty: This fix hasn't been committed yet to the latest dev version.

smitty’s picture

That's not working because in the view you display many nodes (teasers) on the page of the node, the breadcrumb is for. So for setting the breadcrumb you have to make sure, that you process the node of the page (and not the teasers of the view) ant that works only if the nid of the processed node is identical with arg(1).

MGN’s picture

What is the consensus on this? It seems like the original fix should be committed to dev. Please let me know if there are other ideas on this.

smitty’s picture

It seems like the original fix should be committed to dev.

That's my opinion too.

zlex’s picture

Worked for me

MGN’s picture

Status: Postponed (maintainer needs more info) » Reviewed & tested by the community
MGN’s picture

Status: Reviewed & tested by the community » Fixed

Committed to 5.x-1.x-dev branch.

Status: Fixed » Closed (fixed)

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

Xano’s picture

Assigned: Xano » Unassigned