Closed (won't fix)
Project:
Drupal core
Version:
4.6.0
Component:
taxonomy.module
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
26 Mar 2005 at 13:42 UTC
Updated:
11 May 2005 at 22:33 UTC
Jump to comment: Most recent file
Comments
Comment #1
wiz-1 commentedOops, forgot the patch
Comment #2
junyor commentedDon't forget to change the status to patch when you upload a patch. :)
Comment #3
wiz-1 commentedAll right, but moshe weitzman told me not to do this right away:
I assume that you have thoroughly tested the patch before changing status ;)
Comment #4
junyor commentedFair enough. But then you should ask for people to test it. ;)
Comment #5
moshe weitzman commentedA patch for this issue is welcome. I think though that this fix is part of the upcoming folksonomy changes by Morbus ... the fix proposed here might have problems if the user wants to remove all terms on an existing node. not sure.
If you have authored and tested a patch yourself, it is OK to set to patch status. I just object to people moving the testing burden to the CVS reviewers.
Comment #6
morbus iffWell, I plan on redoing the delete code at some point, it is not in my folksonomy patch.
Comment #7
morbus iff+1 from me. I've run across this a few times too.
Comment #8
morbus iffComment #9
morbus iffActually, -1. I have some concerns.
One of my case scenarios was:
* node has a bunch of terms.
* user edits node, deletes all terms.
* ->taxonomy becomes blank. does the delete occur?
The delete DOES occur, but ONLY because ->taxonomy becomes an empty array. It's may be too easy for a third party module to forget to pass an empty array, which would cause the is_array() check to fail, which would cause the delete() never to happen. And, well, this patch would break my upcoming folksonomy patch :)
My understanding is that this hiccup (->taxonomy isn't loaded, delete happens erroneously) would only occur on third party modules or import scripts, and doesn't happen anywhere in core. As such, a low priority, but one that should still be eventually addressed.
Comment #10
killes@www.drop.org commentedFunctions calling node_save should make sure to first load taxo terms. The taxonomy module needs soem love though the code started smelling some time ago. Luckily Morbus might be doing that.
Comment #11
wiz-1 commentedI'm not sure I can agree with the last followup. It is plainly wrong that the code node_load($nid); node_save($nid); will delete all taxonomy terms of the node, especially as this is not documented anywhere AFAIK. This problem may not be triggered by any core modules, but for people like me who develop their own modules it's a bug or at least an annoyance...