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

infojunkie’s picture

Status: Active » Closed (won't fix)

This 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 calling nodequeue_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 to nodequeue_subqueue_add() is retrieved by nodequeue_get_subqueues_by_node(), which itself calls nodequeue_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->count used 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.

wonder95’s picture

Project: Views Bulk Operations (VBO) » Nodequeue
Version: 6.x-1.x-dev » 6.x-2.0
Status: Closed (won't fix) » Active

Moving this to nodequeue issue queue.

ezra-g’s picture

Status: Active » Closed (duplicate)

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

wonder95’s picture

Yup, I just noticed this today and was going to come mark this as a duplicate. Can I just grab the dev version?

ezra-g’s picture

Yes, this is fixed in dev.