The only available hook for reordering is hook_nodequeue_swap($sqid, $nid). looking at the code, this hook is only called from nodequeue_queue_swap. nodequeue_queue_swap is itself only called from nodequeue_subqueue_shuffle, nodequeue_queue_up and nodequeue_queue_down. Any other way to reorder a subqueue (ie. nodequeue_queue_front, nodequeue_queue_back, nodequeue_set_subqueue_positions and nodequeue_save_subqueue_order) will not trigger any reordering hook.

This means a module can ot plug itslef into the reordering of subqueue like it can for node addition and removal.

We need this feature for one of our project (we need to track changes in queues) and I'm willing to work on a patch for this. Calling hook_nodequeue_swap() mutliple times for each nodes in a reordered subqueue seems inneficient. I plan to add an additional hook_nodequeue_reorder($sqid) triggered after completion of any reordering operation.

Files: 
CommentFileSizeAuthor
#8 nq_992326_2_reorder_hook.patch2.76 KBkatbailey
None View
#1 nodequeue_992326_1_hook_nodequeue_reorder.patch2.72 KBpbuyle
FAILED: [[SimpleTest]]: [MySQL] 595 pass(es), 8 fail(s), and 20 exception(es). View

Comments

pbuyle’s picture

Status: Active » Needs review
FileSize
2.72 KB
FAILED: [[SimpleTest]]: [MySQL] 595 pass(es), 8 fail(s), and 20 exception(es). View

Here is a simple patch adding hook_nodequeue_reorder($sqid).

Pol’s picture

Status: Needs review » Reviewed & tested by the community

Applied successfully on nodequeue 6.x-2.9, I succeeded to do what I want ;-)
Patch working flawlessly !

Status: Reviewed & tested by the community » Needs work

The last submitted patch, nodequeue_992326_1_hook_nodequeue_reorder.patch, failed testing.

Pol’s picture

Weird, I applied the patch without any error!

Eric_A’s picture

pbuyle’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, nodequeue_992326_1_hook_nodequeue_reorder.patch, failed testing.

katbailey’s picture

Status: Needs work » Needs review
FileSize
2.76 KB
None View

Glad to see that someone has already beat me to adding this issue, could really use this extra hook. Don't know what the problem is with the patch so am just adding a re-roll to see if we can get beyond the current impasse...

amateescu’s picture

Status: Fixed » Closed (fixed)

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