When adding multiple nodes to a nodequeue (using the "Add to Nodequeues (nodequeue_add_action)") option with VBO, a unique position is not assigned to each node in the queue (i.e. the position field in nodequeue_nodes). In one case, I added 11 items, and 5 had a position of 4, and three had a position of 5. In a second queue, I added 10 items, and they all had the position of 1.
This could be a nodequeue issue, but VBO seemed logical since that's how the nodes are being added.
Comments
Comment #1
infojunkieThis is a design issue with the Nodequeue module. Please keep in mind that VBO does not implement the nodequeue_add_action, which is supplied by the Nodequeue module. VBO merely calls that action.
However, I looked at the code, and AFAICT, here's what's happening:
*
nodequeue_add_action()ends up callingnodequeue_subqueue_add()which does the actual adding of the node to the chosen queue.*
nodequeue_subqueue_add()inserts the new record into the DB, giving it an index of$subqueue->count + 1.* The subqueue that
nodequeue_add_action()passes tonodequeue_subqueue_add()is retrieved bynodequeue_get_subqueues_by_node(), which itself callsnodequeue_load_subqueues_by_reference().* This last function keeps a static cache of subqueues. Hence, the subqueue objects are not refreshed after a node has been added to them, and thus
$subqueue->countused above is not updated.* Because VBO calls the action repeatedly during the same page request, the action retrieves an out-of-date version of the subqueue starting with the 2nd invocation.
Feel free to redirect this issue to the Nodequeue maintainers.
Comment #2
wonder95 commentedMoving this to nodequeue issue queue.
Comment #3
ezra-g commentedThis is a duplicate of #388910: Views bulk operation "add to nodequeue" gives all node the same position., which is fixed.
We're overdue for a Nodequeue release. Expect one this week.
Comment #4
wonder95 commentedYup, I just noticed this today and was going to come mark this as a duplicate. Can I just grab the dev version?
Comment #5
ezra-g commentedYes, this is fixed in dev.