Closed (fixed)
Project:
Nodequeue
Version:
6.x-2.4
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
2 Oct 2009 at 03:36 UTC
Updated:
17 Oct 2009 at 20:40 UTC
Jump to comment: Most recent file
This bug appears on the admin view page of Nodequeue.
If no node title has been entered, clicking on "Add node & save queue" can result in deleting the first item of the queue. I do not know why this does not happen every time though.
This small patch checks if the nid of the given node is null before adding a node, which seems to fix the problem.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | 593858-1.patch | 4.13 KB | ezra-g |
| #1 | 593858.patch | 1.82 KB | ezra-g |
| nodequeue_adding_empty_node_does_no_delete.patch | 592 bytes | michaelsauter |
Comments
Comment #1
ezra-g commentedThanks for calling this to my attention. It turns out there are a few things wrong here:
Clicking the "Add node & save queue" button with no text can result in adding an value to nodequeue_nodes with a nid of 0. This value then counts against the queue's size limit, resulting in the removed node. What's more, nodequeue_check_subqueue_size() is called at the wrong point -- it should be called after we add the node and increase the subqueue size.
I plan to commit this but it would be great go get your testing on this revised patch.
Comment #2
ezra-g commentedActually, we should also add a database update that clears invalid data from the nodequeue_nodes table.
Comment #3
ezra-g commentedThis patch performs validation when the form is submitted, as well as before the values are saved to the database. The form_set_error doesn't highlight any fields, but this is significantly better than what we have now which has no validation and saves bad data to the database.
Comment #4
ezra-g commentedThis is applied. Thanks again for pointing this out.