I develop a module that implement the hook_link_alter() to change the paths. The hook is call for every taxonomy path in the Web Site, but not for the taxonomy breadcrumb. This result in an inconsistency on the Web site.

The workaround that I found is to manually define a path in the taxonomy interface, for every terms used in the system. There is over 80 terms and we now want to allow some users to add / modify the terms. So, the workaround is not any more acceptable.

I hesitate to place this Bug into Feature request, but since there is an inconsistency on the paths, I think this is a Bug.

Comments

MGN’s picture

Category: bug » support
Status: Active » Postponed (maintainer needs more info)

I am not sure I understand what you are suggesting. All that taxonomy breadcrumb does is set the breadcrumb using drupal_set_breadcrumb. It doesn't provide any links that would be altered by hook_link_alter.

Can you explain what part of the code you think needs to be modified. Ideally, go ahead and patch the code so that it behaves as you think it should. Then submit a patch for review.

gaellafond’s picture

Thank you for your reply

The developer team where I work made a module that act over the Taxonomy module. It allow to browse the taxonomy terms differently. We do not use this module to all vocabulary so we have to use a different link to point to the terms (example; the vocabulary "Help" do not use our module so the links are not altered for this particular vocabulary and it works normally).

Example:
The old link that was pointing to the term ID 52:
www.mysite.com/taxonomy/term/52
Our module change that link to:
www.mysite.com/something-else/52
by using the hook_link_alter()

The page www.mysite.com/something-else/52 is generated by our module, and the old page www.mysite.com/taxonomy/term/52 is not used at all and should not be accessible from the Web site.

I found a Web site that discuss about a similar solution, but they just get ride of links instead of modifying them. Maybe that can help you to understand what we are doing:
http://blamcast.net/articles/remove-taxonomy-custom-nodes

Everywhere in our web site, the new links are good because the hook is called to modify the links before using it. Everywhere except in the taxonomy breadcrumb.

The previous solution was to alter the link manually by adding a custom path to the term (example: "something-else/52") to the taxonomy breadcrumb interface (Administer > Content management > Taxonomy > Edit term: Field Breadcrumb path), but we can not use this workaround any more. We have too many terms to maintain and we can not ask our users to add a path that contains the term ID, only to display the breadcrumb correctly on some pages. That's too advanced for them, they will introduce errors or they will forget to do it.

Since it was a critic bug for us, I decide to copy the function that generate the breadcrumb (generate_breadcrumb) and modified it to do what we want it to do. I don't know how we are suppose to call hook, so I copy this function to our module and I called the hook manually with the hook function name. This fix is not suitable for a patch since it will only work with our module.

I'm sad to say that we are currently not using the taxonomy breadcrumb module. The altered copy of the generate_breadcrumb function is doing the job. Of course, if you find a way to fix that, we will be happy to use your module again.

Thanks

gisle’s picture

Issue summary: View changes
Status: Postponed (maintainer needs more info) » Closed (outdated)

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.