Wrong breadcrumb with view

smitty - February 22, 2008 - 15:56
Project:Taxonomy Breadcrumb
Version:5.x-1.4
Component:Code
Category:bug report
Priority:normal
Assigned:Xano
Status:closed
Description

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.

#1

_craig - February 23, 2008 - 02:46

Interesting solution. I like it.

#2

_craig - March 15, 2008 - 18:59
Status:active» closed

#3

smitty - September 11, 2008 - 12:15
Status:closed» 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?

#4

Xano - September 29, 2008 - 07:50
Assigned to:Anonymous» Xano

What about this?

<?php
if (arg(0) == 'node') {
// Do the move!
}
?>

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

#5

smitty - December 9, 2008 - 09:23

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).

#6

MGN - January 12, 2009 - 03:43

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.

#7

smitty - January 15, 2009 - 13:19

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

That's my opinion too.

#8

zlex - March 3, 2009 - 20:52

Worked for me

#9

MGN - March 4, 2009 - 15:10
Status:postponed (maintainer needs more info)» reviewed & tested by the community

#10

MGN - March 12, 2009 - 19:23
Status:reviewed & tested by the community» fixed

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

#11

System Message - March 26, 2009 - 19:30
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.