When adding tags on the Tags tab for any given node, I've noticed that all of the terms assigned external to Community Tags will completely disappear. I'm uncertain as to whether I have some kind of special setup, but I was able to isolate the error down to a single SQL statement.
On community_tags.module:479, a query is made to load all terms which are not community tag-related. These terms are then removed from term_node. This is where I'm losing all of my term data.
If this is trying to prevent duplicate node data from existing in term_node, then the c.nid IS NULL should be changed to c.nid IS NOT NULL (duplication would never occur if the table is keyed). Otherwise, I have no idea why it should be deleting in term data, especially data which it may not have added itself.
Comments
Comment #1
fractile81 commentedChanging the status, as I started the this issue before I really understood what the query was trying to do.
Comment #2
canadrian commentedI have the same issue. I am converting an existing vocabulary, with thousands of already-tagged nodes, into a community-tagging vocaublary. But when you add tags to a node, this module seems to remove existing tags. I can't see how this could be a desirable behaviour. Also, I am concerned that should I disable this module in the future, it will remove the tags it has assigned to nodes. Is this the case?
Comment #3
chromeyellow commentedConfirm this bug. 2 slightly different aspects.
1) CT Wipes out all pre-existing tags. After that, it plays nice with its own tags. However, it attributes a whole jumble of tags to user - i.e. "you have already tagged this node. Your tags:..." lists more than user's own tags.
2) Wipes out terms from other (i.e. non-tagging) vocabs. Repeatedly! I.e., even if you re-apply a term from another vocab, it will be wiped again next time a tag is added.
FWIW appears in both php 4.3 and php 5.
Comment #4
micheleannj commentedBump. I'm having the same issue.
I'll try and gather some details on what's going on.
I'm going to have to remove the module until this is sorted out (though that doesn't help with what's already been lost!).
A warning needs to be posted so that other users do not loose their data.
Comment #5
micheleannj commentedSo I just reread the above, is "c.nid IS NULL should be changed to c.nid IS NOT NULL" a fix? It wasn't clear.
Thanks
maj
Comment #6
fractile81 commentedNot really understanding what the chunk of code is doing from lines 478 to 483, I'm not sure that the change to the query is really a fix. By changing the query to have
IS NOT NULLyou are essentially going to delete anything in term_node that matches up in the community_tags table. I would almost suggest commenting out these lines of code for the time being, until someone that understands why that code is there can elaborate on it. I say "almost suggest" because I cannot verify that this wouldn't cause some other problem, but tags would certainly no longer be deleted.Comment #7
Steven commentedFixed in 5.x and HEAD.
Comment #8
nirad commentedI just installed the updated module and I got the following error when trying to add tags. However, I can verify that it does not delete the existing node taxonomy.
warning: Cannot modify header information - headers already sent by (output started at C:\apache2triad\htdocs\ripsift\modules\community_tags\community_tags.module:424) in C:\apache2triad\htdocs\ripsift\includes\common.inc on line 141.
Comment #9
nirad commentedI created a new thread for the bug I report above, as it does not seem related to this problem (losing taxonomy terms) which has been fixed.
Comment #10
(not verified) commentedComment #11
Anonymous (not verified) commentedI have to reopen this. Tags from other taxonomies (as created by the category module) do indeed stay in place, but the forum taxonomy is still deleted. Meaning: someone tags a forum post and it disappears from the forum it belongs to. I had to learn this the hard way as we today tagged all our forum postings and now the forums are empty...
Comment #12
Anonymous (not verified) commentedWell, I guess then I should also change the status to "active". Sorry.
Comment #13
Anonymous (not verified) commentedAnother detail: I suspected that this might be a problem related to OG forum, which I use, but it also affects the "standard" forums (not too surprising, I guess, as they all are based on the same vocabulary).
Comment #14
Anonymous (not verified) commentedThere is a patch out there which seems to take care of this problem, see
http://drupal.org/node/159479
Comment #15
owahab commentedAlmost the same problem is discussed here: http://drupal.org/node/159479