_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

halstead - June 21, 2009 - 20:35

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

dmudie - July 20, 2009 - 17:04

Thanks halstead. I was seeing this too with a workflow trigger publishing action (node_save_action). Your patch seems to work for me.

#3

NancyDru - September 9, 2009 - 20:47
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

halstead - September 15, 2009 - 17:37
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

System Message - September 29, 2009 - 17:40
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.