Closed (fixed)
Project:
Weight
Version:
6.x-1.0-beta3
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
28 May 2009 at 21:10 UTC
Updated:
23 Sep 2009 at 20:50 UTC
Jump to comment: Most recent file
Found a bug in this module today which happens if a user without "assign node weight" permissions updates a node which had previously had a non-zero weight assigned.
Upon saving the node, the node's weight value gets reset to 0, since the node_form doesn't store the original value anywhere, and the logic of the hook_nodeapi implementation then resets it.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | weight.475824.patch | 963 bytes | spiderman |
Comments
Comment #1
spidermanAttached is a simple patch which fixes this by adding an else clause to the second block of the hook_form_alter implementation, which deals with the node_form. This clause happens if users don't have permissions to update the node's weight value, and simply adds a 'value' field to the node_form which stores the original value of the node weight field, so that it will get stored properly when saving.
Comment #2
nancydruThanks for the patch.
Committed to 6.x-1.x-dev.