Closed (won't fix)
Project:
Workflow
Version:
5.x-1.1
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
10 Jan 2008 at 00:48 UTC
Updated:
14 Nov 2011 at 14:41 UTC
Maybe I'm missing something, but is it not possible to trigger an action on node deletion from within Workflow Module?
Comments
Comment #1
JacobSingh commentedHi,
Currently, it doesn't do that. It could, I guess, but see the code in nodeapi:
So it's a little weird to call a hook passing in the node and its workflow state, etc if the majority of actions both in the actions module and via my new workflow_ng integration are going to bail on it because the node is not going to exist...
I'm not sure what we should do here, should we add the hook and just warn people in the docs? Currently the workflow module only fires on state changes, and since this isn't a state change, I don't know how we should handle it.
What is your intended functionality?
Best,
j
Comment #2
mshaver commentedI have been following your workflow_ng integration, but haven't tried it. Seems like you're on the right track though with the integration of the two modules. I tried just using workflow_ng, and it didn't provide some of the functionality I needed.
Can workflow_ng detect when a node is being deleted now? All I am trying to do is trigger an e-mail alert for certain content types when they are deleted. I'm pretty sure there is a PHP snippet floating around with something like this, but I thought it would be better to manager within workflow.
Thanks
Comment #3
JacobSingh commentedworkflow-ng can detect when a node is deleted (use the event "node is deleted"), then you can add a condition using tokens like "node:workflow-current-state" == "published" if you want a workflow_ng action to fire when a published node is deleted, but not otherwise...
Does that make sense? Maybe you should try it out.
My workflow_ng integration has two parts
1. Token support for workflow, so you can use tokens like workflow old state, etc.
2. a workflow-ng event so that workflow ng can be fired on workflow changes (via hook_workflow).
In your case, you would use the 1st feature, not the second one, because on delete, hook_workflow doesn't fire.
Give it a whirl, I'd love to see some traction on it, as I feel it's a good solution for complex needs.
Best,
Jacob
Comment #4
Bastlynn commentedHi,
With the release of Drupal 7, Drupal 5 is no longer receiving security updates, reviews, or development from many contributed modules. Since 5 is now considered a depreciated version, you really should seriously look into upgrading to Drupal 6 or 7. The newer versions of Drupal work better, have more support, and will be safer (literally! security patches!) for your website. We are currently working on a new release for Workflow to Drupal 7. In light of that, further support for Drupal 5 issues is infeasible at the moment. Please consider upgrading to Drupal 6 or 7 in the near future - you'll be glad you did.
- Bastlynn