Closed (fixed)
Project:
Node Auto Term [NAT]
Version:
5.x-2.1
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
24 Oct 2008 at 15:23 UTC
Updated:
28 Feb 2009 at 18:20 UTC
We have found that when doing node_save() on a node that uses NAT, if the node has an associated term with a weight other than 0, the weight gets reset to 0.
_nat_update_terms() defines the weight as 0 when it sets up the edit array and does not use the weight from the terms that are passed in. We solved the problem by taking the term weight and assigning it into $edit before calling taxonomy_save_term():
$edit['tid'] = $term->tid;
+
+ if (isset($term->weight)) {
+ $edit['weight'] = $term->weight;
+ }
+
taxonomy_save_term($edit);
Here is a patch that implements this. Thanks to miche for her help in solving this issue!
| Comment | File | Size | Author |
|---|---|---|---|
| nat_preserve_term_weight.patch | 377 bytes | MMachnik |
Comments
Comment #1
miche+1
Comment #2
anantagati commentedLooks good for me.
Comment #3
Zen commentedCommitted to D6 and D5.
Thanks for the patch and review :)
-K