Breadcrumb hierarchy is opportunistically determined on node pages
solotandem - October 27, 2009 - 20:32
| Project: | Taxonomy Breadcrumb |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Description
From my reading of the code and testing it with different paths, it seems the code in _taxonomy_breadcrumb_node_get_lightest_term opportunistically determines the base of the breadcrumb path based on the least value of all of the parent term ids applying to the node. This code assumes the term ids reflect the hierarchy order. Instead, should not the code determine the hierarchy from the actual relationships in the data?

#1
The attached patch determines the hierarchy from the actual relationships in the data.
#2
Please consider testing the patch in #372813: Reordering taxonomy terms with drag-and-drop removes taxonomy breadcrumb path. I think it addresses this issue as well, and is probably ready to be committed.
Thanks
#3
Looking at the second patch on comment #25 of #372813: Reordering taxonomy terms with drag-and-drop removes taxonomy breadcrumb path, it appears to rely on the weights of the terms. As mentioned above, since we are trying to display a breadcrumb hierarchy, the actual hierarchical relationships in the data should be utilized. From my tests with taxonomy user interface, I could enter terms, rearrange them (using the drag handles), and rearrange them again (saving after each step), and still have all with weights of zero. In this case, the patch might not produce the hierarchy.
The patch I submitted will work with a "single path of terms to the node." I assumed this case. The patch could get interesting results with the taxonomy relationships In your example (essentially two paths to the node through New York and Alberta). Yet, I believe it is using the correct approach of reflecting the actual hierarchical relationships in the data.