Taxonomy_context disables breadcrumbs
kbahey - October 8, 2004 - 19:55
| Project: | Taxonomy context |
| Version: | HEAD |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | nedjo |
| Status: | patch (code needs review) |
Description
After installing taxonomy_context, I found that the breadcrumbs trail on the top of the page (e.g. Home >> Places >> Africa >> Egypt) is not visible anymore.
Why does taxonomy_context do that? It should not disabled such a useful feature.

#1
Her is a comparison of the HTML source before the taxonomy_context module, and after it:
Before:
<div id="main"><div class="breadcrumb"><a href="">Home</a> » <a href="taxonomy/term/12">Places</a></div>
<h1 class="title">Africa</h1>
After:
<div id="main">
<div class="breadcrumb"><a href="">Home</a></div>
<h1 class="title">Something</h1>
<div id="help"><div class="term-container">
<div class="term">
<div class="description"></div>
<div class="links"><a href="admin/taxonomy/edit/term/50" title="Administer this term.">administer</a></div>
</div>
</div>
<div class="clearit"></div>
#2
I've removed the drupal_set_breadcrumb call (which I think worked in 4.4 but apparently isn't needed now).
#3
Hi
Thanks for responding.
I did some debugging on your code. I reenabled the commented part about breadcrumbs.
The issue is not with the code in the taxonomy_context_get_breadcrumb() function, but rather the call to this function from taxonomy_context_init(). $context->tid is set to nothing, and therefore taxonomy_context_get_breadcrumb() returns nothing.
I am not sure where this $context->tid should be set from, but that is the cause of the problem where breadcrumbs are not displayed.
#4
Changing status to active.
Even after commenting out this section, the breadcrumbs are not displayed by Drupal.
#5
Clarification:
The breadcrumbs do show when you are on a taxonomy, but do not get displayed when you are on a node.
So if you are on a term, and listing all the child nodes under it, the breadcrumbs will show (from Drupal, not from taxonomy_context). But of you click on a term, Drupal will not show any breadcrumbs about the node (only Home).
I don't think this is a problem with taxonomy_context itself, but why does the breadcrumb not show??
#6
There is a bug in the module.
function taxonomy_context_init() {
[snip]
// Commented out in response to issue http://drupal.org/node/11407
if (($mode == "taxonomy") || ($node_type == "story") || ($node_type == "page")) {
drupal_set_breadcrumb(taxonomy_context_get_breadcrumb($context->tid));
}
}
The problem with the commented code is that there is no $context defined here. If you add this line:
$context=taxonomy_context_get_context();
right before the if statement
and you uncomment the rest, the module works brilliantly!
#7
Patch for making breadcrumbs appear when using taxonomy_context.
Nedjo, can you please incorporated into CVS.