The hook_nodequeue_delete() which has been introduced in the current 7.x-2.x branch, is currently providing a queue ID to any implementations, AFTER all queue data has been deleted from the database.
This means that modules implementing the hook, does not have any information about the queue unless they are storing the data themselves.
A proper way would be to provide a nodequeue object to the hook.This is also the standard drupal way, as seen in hook_node_delete() for instance. http://api.drupal.org/api/drupal/modules!node!node.api.php/function/hook...
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | nodequeue-delete_hook_should_provide_object-1978764-2.patch | 663 bytes | esbenvb |
| #1 | nodequeue-delete_hook_should_provide_object-1978764-1.patch | 0 bytes | esbenvb |
Comments
Comment #1
esbenvb commentedThis patches fixes the issue.
IMPORTANT! When porting this patch, make sure that the correct GIT attribution is used, as mentioned on http://drupal.org/user/989064
Comment #2
esbenvb commentedSorry, wrong file content. THIS patch it is...
Comment #3
othermachines commentedI think you're probably correct that this is a better way, but this will break modules already implementing
hook_nodequeue_delete(), including smartqueue.module. I wonder if it might be better to introduce the object as an additional (optional) argument.Comment #5
fizk commented@othermachines, good call. The new hook is now
module_invoke_all('nodequeue_delete', $qid, $queue);