Incorrect vocabulary used by module when choosing term for breadcrumb. In comments to source code it says "Only consider terms in the lightest vocabulary" which makes sense, but in the same time code select VID of first term attached to node. And this is not always the same as lightest vocabulary. Simple patch attached.

---
--- taxonomy_breadcrumb.inc.orig 2010-11-17 12:12:27.000000000 -0600
+++ taxonomy_breadcrumb.inc 2010-11-17 12:21:46.000000000 -0600
@@ -47,9 +47,10 @@
$terms = taxonomy_node_get_terms($node);
if (!empty($terms)) {
if (count($terms) > 1) {
+ $vocs = taxonomy_get_vocabularies();
foreach ($terms as $term) {
// Only consider terms in the lightest vocabulary.
- if (!isset($vid)) {
+ if (!isset($vid) or $vocs[$vid]->weight > $vocs[$term->vid]->weight) {
$vid = $term->vid;
}
elseif ($term->vid != $vid) continue;

CommentFileSizeAuthor
taxonomy_breadcrumb.inc_.patch588 bytespavel.karoukin

Comments

skizzo’s picture

Confirming: I had multiple vocabularies and the "wrong one" was picked by Taxonomy Breadcrumb.
Above patch fixed the problem. Thank you.

Chinasky314’s picture

I have aplied the patch and doesnt change..... I have even changed the vid in the data bases and is still not working.... Please some help... I dont find anything in google...

gisle’s picture

Issue summary: View changes

The Drupal 6 version is no longer supported. Closing this as outdated. If you think this is still relevant for Drupal 7 or Drupal 9, please open a new issue.

gisle’s picture

Status: Needs review » Closed (outdated)