Download & Extend

_weight_encode called multiple times

Project:Weight
Version:6.x-1.0
Component:Code
Category:bug report
Priority:normal
Assigned:halstead
Status:closed (fixed)

Issue Summary

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.

Comments

#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.

AttachmentSize
weight-498042.patch 843 bytes

#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

Status:active» fixed

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

Assigned to:Anonymous» halstead

Thanks for the tip NancyDru. I've reviewed the issue queue handbook. Hopefully I will be more helpful to maintainers now. :)

#5

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.