Closed (duplicate)
Project:
Drupal core
Version:
6.x-dev
Component:
taxonomy.module
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
3 Jun 2009 at 13:26 UTC
Updated:
10 Nov 2010 at 13:59 UTC
When using the drag and drop facility on the vocabulary list terms page, term relations and terms synonyms are lost for all terms that are updated.
As a single term repositioning can lead to many other term weights needing to be updated much information can be lost.
I tracked it down to the taxonomy_overview_terms_submit function in taxonomy.admin.inc where changed terms are updated (actually deleted and re-inserted) without their synonym and relations data.
I was able to fix it by adding the following lines just before changed terms are saved at line 524:
$term['relations'] = array_keys(taxonomy_get_related($term['tid']));
$term['synonyms'] = implode('\n', taxonomy_get_synonyms($term['tid']));
Comments
Comment #1
chaps2 commentedAnybody care to comment? I tested this on a completely fresh install of 6.x-dev. I tried to test D7 as well but the drag and drop facility wasn't available.
Comment #2
Dracolyte commentedThis is a critical issue for me too. I am also having the term description disappear, so I will need to add a line of my own to your patch. What's worse, I'm using NAT and when I edit a node that is also a term, I lose all the term information then also. So this problem may extend beyond drag-and-drop.
I'll test and report back what I find.
Comment #3
Dracolyte commentedOkay, I tried your code with drag-and-drop and it fixes the problem totally. Thanks!
Unfortunately for me, updating a node linked to a taxonomy term via NAT *still* deletes the term's description, synonym, and relations, so I'll open that problem up in a new issue.
Comment #4
momper commentedsubscribe
Comment #5
jefkin commentedWhy hasn't some Taxonomy buff tossed this into the works, I mean the NAT stuff is separate, fine, but the core issue remains in current drupal 6 line now.
I just encountered this BUG on 6.15. My search turned this issue up.
I mean I know everyone's excited about drupal 7, but it seems that 9 months is a long time for a critical core issue like this to wait.
Can some friendly patch writing guy (or girl) put these two lines into patch form?
I never learned how, and I don't have time to right now. As it is, I'll just have to make this change by hand in my version of core every time... yuck.
Comment #6
franravi commentedSubscribe also.
Just add this fix to core please!
Comment #7
chaps2 commentedFYI - these are the currently outstanding issues that deal with the same or similar problems.
Duplicate #944100: Problem in taxonomy interface, erase taxonomy relation.
Similar bugs (but only mention synonyms): #748412: synonyms lost when terms are re-weighted, #251255: Taxonomy term synonyms and relations clear after re-ordering using drag-and-drop feature.
Bug with similar symptoms but for terms with multiple parents - #680688: Terms with multiple parents disappear after Edit/Save.
Possibly related: #302148: Drag n drop functionality in Taxonomy just broke my site
Comment #8
chaps2 commentedMarking as duplicate of #251255: Taxonomy term synonyms and relations clear after re-ordering using drag-and-drop feature. For a fix, see the patch posted in comment #52 there - the fix in the original post above is no good.