[drupal-devel] [bug] possible bug in taxnomy_node_save
Junyor
drupal-devel at drupal.org
Sat Mar 26 13:58:12 UTC 2005
Issue status update for http://drupal.org/node/19494
Project: Drupal
Version: cvs
Component: taxonomy.module
Category: bug reports
Priority: normal
Assigned to: Anonymous
Reported by: wiz
Updated by: Junyor
-Status: active
+Status: patch
Don't forget to change the status to patch when you upload a patch. :)
Junyor
Previous comments:
------------------------------------------------------------------------
March 26, 2005 - 14:42 : wiz
Hi,
taxnomy_nodeapi calls taxonomy_node_save on insert and update. This
function, in turn, saves the taxonomy of the node. Unfortunately it
first deletes all terms for the current node, and then inserts them
again /if they have been loaded before/. taxonomy_nodeapi doesn't
respond to 'load'. Therefore, unless you've done something like
$node->taxonomy = taxonomy_node_get_terms($node) the terms are lost.
See: http://drupaldocs.org/api/head/function/taxonomy_node_save
Solution: move the call to taxonomy_node_delete($nid) inside the if
(is_array($terms)). When the terms haven't been loaded they won't be
saved either.
------------------------------------------------------------------------
March 26, 2005 - 14:43 : wiz
Attachment: http://drupal.org/files/issues/taxonomy-save.patch (471 bytes)
Oops, forgot the patch
More information about the drupal-devel
mailing list