My apologies if I just missed the code somewhere, but I don't actually see the 'swap' or 'shuffle' hooks actually ever called by nodequeue (6.x-2.9). I do see the module_invoke_all('nodequeue_swap' in the nodequeue_queue_swap() function, which is in turn called by nodequeue_queue_up(), nodequeue_queue_down(), and nodequeue_queue_shuffle(), but I don't see any of those three functions themselves used anywhere in the code. Were these designed to be used by other modules somehow?

We are trying to find and use swap and shuffle hooks, and I see the code defined, but I just didn't see them actually executed anywhere.

Comments

justageek’s picture

As an edit to my post, I see in the dev code that you implemented nodequeue_save_subqueue_order_alter(), is that intended to replace the swap and shuffle hooks?

EDIT: sorry, I think I see the intent, but I would love clarification. It looks like nodequeue_queue_up, _down(), and _swap() are intended to be api functions that can be used by other modules. so, the core nodequeue module doesn't use them and does not invoke the 'swap' hook. The new 'order_alter' hook will allow modules to respond to general re-ordering of queues.

I would like to recommend that you use call_user_func() for the order_alter hook rather than $function, as many developers are moving to class-based method calls, such as MyQueueCode::orderAlter(), and call_user_func() will allow this to happen while $function will not.

gnuget’s picture

This also apply for the Version 7.x-2.0