This is a fork of the 6.x issue #974664: Incorrect vocabulary used by module when choosing term for breadcrumb. I installed the patch from that issue in 7.x-1.x-dev (2011-Jul-05) and it resolved the problem. Taxonomy Breadcrumb correctly picks the lightest weight vocabulary.

Comments

elgandoz’s picture

subbing. Still present and this must be fixed.

Anonymous’s picture

Applied patch. Still having problems - hierarchical vocabulary always ignored, always picks lightest single level vocabulary.

Update: Issue resolved after 'Sort alphabetically' was hit in lightest vocabulary.

theprecarious’s picture

Hello, I'm a newbie and this is my first post.
I was having the same problem of getting the wrong vocabulary, which persisted after applying the patch.

I don't completely understand the code (especially why it is looking at the weight of the parents), but I found that adding a few lines to the patched code resolved my problem.
I'd like feedback to see if my approach is valid, or if a better solution lies elsewhere.

In my case, I had a number of "tags" (heavier vocabulary) and one "category" (lightest vocabulary). The code would go through and find the lightest of (the parent of?) the "tags", then would recognize that the "category" vocabulary was lighter than the "tags" and reset vid, but in the subsequent code the weight of the category term was heavier than lweight, and the function would return the term out of the "tags" vocabulary.

        if (!isset($vid) or $vocs[$vid]->weight > $vocs[$term->vid]->weight) {
          $vid = $term->vid;
+ /*reset lweight and lterm when we find a lighter vocabulary
+   otherwise terms from a prior heavier vocabulary can be returned. */
+         $lweight = NULL;
+         $lterm = NULL;
      }

Feedback appreciated.

amogiz’s picture

Subscribing : that really does not work properly !

firebird’s picture

I've re-written the vocabulary selection code. It now selects the first term from the lightest vocabulary. Or, if it's still not selecting the vocabulary you wanted, there's a manual override vocabulary selection on the taxonomy breadcrumbs admin page.

firebird’s picture

Removed whitespace warnings from the patch.

theprecarious’s picture

The patch in #6 appears to be working for my case. It is selecting the correct vocabulary in the code and the admin override is also working.

spidersilk’s picture

I tried to apply the patch in #6, and got the following:

error: patch failed: taxonomy_breadcrumb.module:64
error: taxonomy_breadcrumb.module: patch does not apply

firebird’s picture

Are you trying to patch the right version of taxonomy_breadcrumb? The patch applies just fine for me against 7.x-1.x-dev.

Also note that if you've already applied some patches to your module, that may cause the patch to not apply, in which case you need to apply it manually.

spidersilk’s picture

It is the dev version, and I don't recall applying any other patches, but it's possible that I did some while back and just forgot about it... So I reinstalled the module (same version) and reapplied the patch, and this time it seems to have worked. Thanks!

jantoine’s picture

StatusFileSize
new5.07 KB

It seems that the patch in #6 attempts to address the issues below in addition to the issue described in this thread.
#1222922: Trying to get property of non-object
#1197782: Give users the choice of which vocabulary to use by default.

Patches should fix a single issue described in the issue summary. I have uploaded a new patch that simply fixes the issue of returning the lightest vocabulary/term associated with a node.

jantoine’s picture

StatusFileSize
new5.06 KB

Fixed an issue where checking if a vocabulary was found always returned true.

Taxoman’s picture

@AntoineSolutions:
The maintenance status of this module is currently "unknown", no updates for a year now, despite interest and patches from the community.

If you are interested, I would like to encourage you to apply to be a co-maintainer so you can commit patches and help move this module forward.

jantoine’s picture

Status: Needs review » Fixed

Patch from #12 committed.

Status: Fixed » Closed (fixed)

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