_weight_encode called multiple times
halstead - June 21, 2009 - 20:23
| Project: | Weight |
| Version: | 6.x-1.0 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | halstead |
| Status: | closed |
Description
When node_save is called multiple times all nodes are made sticky. This happens when using workflow/triggers and node_save_action is called. As a result weight_nodeapi is called twice with $op "presave", the first call works as expected while the second always makes the node sticky.

#1
This tiny change has fixed the problem for me but I don't know what other issues may be caused. Basically I'm preventing double encoding by only testing for sticky values of 0 or 1. If the sticky value is already -100, 100, -94, 94, or any "weighted" number no change is made.
#2
Thanks halstead. I was seeing this too with a workflow trigger publishing action (node_save_action). Your patch seems to work for me.
#3
Thanks for the patch. In the future, mark it as "Needs review" and assign it to yourself.
@dmudie: You could have marked it as "Reviewed and tested".
Committed to 6.x-1.x-dev.
#4
Thanks for the tip NancyDru. I've reviewed the issue queue handbook. Hopefully I will be more helpful to maintainers now. :)
#5
Automatically closed -- issue fixed for 2 weeks with no activity.