I'm trying to implement hook_nodequeue_remove to prevent a queue going down to zero.
function mymodule_nodequeue_remove($sqid, $nid) {
$subqueue = nodequeue_load_subqueue($sqid, TRUE);
dsm($subqueue);
if ($subqueue->count == 0) {
dsm('EMPTY!!!!');
}
This code doesn't work.
When I remove the last node in nodequeue admin, the count is given as 1. When I remove the last node on the node's nodequeue tab, the count is given as 0. Hence I can't reliably test whether the node being removed is the final one.
(I've tried the patch at #959450: hook_nodequeue_remove gets called twice when a node is removed from a subqueue., which has no effect on this bug.)
Comments
Comment #1
amateescu commentedFixed with attached patches in 6.x and 7.x.
http://drupalcode.org/project/nodequeue.git/commit/38cc835
http://drupalcode.org/project/nodequeue.git/commit/d4f2eed
Comment #3
joachim commentedThis is still a problem.
If I remove more than one node in the queue admin page, then only the last one gets the hook invoked:
Comment #4
joachim commentedActually, filing this problem as a new bug as it impacts other things and it's to do with the whole form rather than just this piece of code: http://drupal.org/node/1212896