Project:Nodequeue
Version:6.x-2.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:needs work
Issue tags:Simpletest

Issue Summary

If I'm implementing a smart queue, how can I hook the delete of a queue in order to take actions based on this?

Comments

#1

Title:How to hook delete of queue in a smartqueue?» Hook for queue deletion
Version:6.x-2.4» 7.x-2.x-dev
Category:support request» feature request

Great question! The answer seems to be that you can't. It would be relatively simple to add a hook for queue deletion, probably involving nodequeue_delete(). Patches welcome :).

I'm interested to hear what kid of subqueue you're creating.

#2

Here is a shot at a patch. I think it is pretty simple, the only question would be if there is a better way to get the queue before the delete?

AttachmentSizeStatusTest resultOperations
smartqueue_delete.patch1.46 KBIdleFAILED: [[SimpleTest]]: [MySQL] Drupal installation failed.View details | Re-test

#3

Status:active» needs review

Marking as needs review.

#4

Status:needs review» needs work

Thanks for the patch! This looks like a good start. We should probably place this new hook in the nodequeue_delete function, so that it will be called even when queues are deleted programatically, not just through the interface.

This looks otherwise commit worthy.

#5

Attached with api call moved to nodequeue_delete.

Let me know if that works.

Thanks.

AttachmentSizeStatusTest resultOperations
smartqueue_delete.patch1.42 KBIdleFAILED: [[SimpleTest]]: [MySQL] Drupal installation failed.View details | Re-test

#6

Any update on getting this merged in?

Thx.

#7

Status:needs work» needs review

Sorry, this was marked as "needs work" so I didn't see it. Hope to review this weekend. Thanks for the bump!

#8

Status:needs review» needs work

Thanks for the re-roll.

This needs a bit more work before it can be committed:

A) Since we're firing this hook in nodequeue_delete instead of nodequeue_delete_submit, the hook should probably be called nodequeue_api_queue_admin_delete
B) There's no reason to pass the empty $form_state variable.

Sorry about the delay in re-reviewing this. I can turn this around quicker with another re-roll.

Thanks!

#9

We need this feature for one of our project. So I updated the patch from #5 updated to fit recommandation in #8.

AttachmentSizeStatusTest resultOperations
nodequeue_606150_9_smartqueue_delete.patch1.4 KBIdleFAILED: [[SimpleTest]]: [MySQL] Drupal installation failed.View details | Re-test

#10

Version:7.x-2.x-dev» 6.x-2.x-dev
Component:Miscellaneous» Code
Status:needs work» needs review

#11

Patch attached with a small code style cleanup and an extra test.

This patch is totally bunk. Grr.

AttachmentSizeStatusTest resultOperations
smerrill-606150-nodequeue-delete-hook.patch191.79 KBIdleFAILED: [[SimpleTest]]: [MySQL] 600 pass(es), 9 fail(s), and 21 exception(es).View details | Re-test

#12

Status:needs review» needs work

The last submitted patch, smerrill-606150-nodequeue-delete-hook.patch, failed testing.

#13

I fail to see what failed for the automated testing of my patch submission in #9. The log at http://qa.drupal.org/pifr/test/113444 only says "'failed to complete installation".

#14

#15

Status:needs work» needs review

#11: smerrill-606150-nodequeue-delete-hook.patch queued for re-testing.

#16

Status:needs review» needs work

The last submitted patch, smerrill-606150-nodequeue-delete-hook.patch, failed testing.