Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Environment
Drupal 6.19
Hierarchical Select 6.x-3.6
Configuration
I have simple hierarchy of tags:
- Human Resource -> Absence Management -> Time Off.
- Employees -> Time Management
I'm using lineage hierarchical select for taxonomy.
"Human Resource -> Absence Management -> Time Off" tags are assigned to a node.
Bug
I re-ordered taxonomy and moved "Time Off" and placed it under "Employees -> Time Management" .
I am editing the node and:
- the "Time Off" tag is no longer assigned to post under old ancestors "Human Resource ....". CORRECT
- the "Human Resource -> Absence Management" are still assinged to node - CORRECT
- the "Time Off" with its new ancestor "Employees -> Time Management" is not assigned to a node - WRONG
So effectively re-organization of taxonomies and reediting nodes will cause loosing tags that has been moved during taxonomy re-organization.
I think this is related to #976394: Save term lineage does not work with current multilevel taxonomies
Comments
Comment #1
Peter Swietoslawski CreditAttribution: Peter Swietoslawski commentedOn a note side core Taxonomy module behaves as expected. You have a hierarchy of tags assigned to a post, you reorganize taxonomy, you reedit the post and all the tags that used to be assigned to a node are still highlighted in tags selection box (of course the new ancestors for the tags that have been reorganized are not selected but that's expected and that's why we need "lineage save" option from Hierarchical Select module :) )
Comment #2
wjaspers CreditAttribution: wjaspers commentedI'm upgrading this priority to "critical" because I found a similar, yet more disturbing problem.
I lost ALL of my product catalog term assignments by changing the lineage setting.
Views couldn't even locate (even with the HS Views module OFF) items that were tagged before enabling and adjusting the HS module settings.
Comment #3
wjaspers CreditAttribution: wjaspers commentedDiscovered this afternoon that the problem stems from HS's cache tables. I have a feeling they aren't being flushed on the same cache flushes as the rest of the site.
I solved the problem by resolving it the dangerous way:
mysql>TRUNCATE table cache_hierarchical_select;
(not recommended).Comment #4
Wim LeersDue to the nature of saving the lineage, there is no work-around possible for this. You have to make sure that you don't need to alter any lineages, because otherwise the saved lineages will of course no longer be entirely correct.
This is NOT a bug. It's a limitation of core's Taxonomy.
If you don't want this problem, then don't use vocabularies in which you have terms with multiple parents. Then you don't need to use the "save lineage" functionality, and then you don't have this problem. I'm sorry, but there really isn't anything I can do about this.
Comment #5
jcisio CreditAttribution: jcisio commentedWim Leers,
I reopen this because I think:
- The core Taxonomy module does thing right: for example, when a term is deleted, it is also deleted from term_data. HS does not do that on its CCK field.
- There is a work-around: use hook_taxonomy to reset the lineage on term save/del.
Comment #6
jcisio CreditAttribution: jcisio commentedComment #7
jcisio CreditAttribution: jcisio commentedA few comments:
So, I use hook_taxonomy() in my custom module to solve my specific problem. Sorry that it did not result in a patch for HS, but it would take too much time for me. I let Wim Leers leave this as "active" or "won't fix" this, as it is a real bug.
Comment #8
stefan.r CreditAttribution: stefan.r commented6.x issue without activity for over 3 years, closing.
Please reopen if this is still an issue in 7.x.