It would be very useful to have the following function:
workflow_schedule_transition
This function would take in the following fields just like the insert/update section of the nodeapi function:
- node - Required
- workflow_scheduled_date - Required
- workflow_comment - Optional
- workflow_scheduled_hour - Optional
It would function exactly like the code does in the nodeapi function creating the appropriate entry in the workflow_scheduled_transition table. Basically, I'm in the process of writing some actions to schedule future transitions. I would prefer to use this method instead of the scheduled actions module for several reasons...mainly that this way will allow for the user to easily see that a given node has a scheduled transition existing and also would allow people with the appropriate workflow permissions to easily edit the scheduled date. Currently, my actions are simply updating the workflow_scheduled_transition table themselves, but I don't like this solution as I then have to update my actions any time anything in the workflow_scheduled_transition table changes.
ALSO this would require one more slight change....in the workflow_execute_transition function, the module_invoke_all('workflow', 'transition post') call should occur AFTER deleting the current entries from the workflow_scheduled_transition table. If the entries are deleted after this call as it currently is coded, any transitions scheduled by actions related to the current transition will be deleted. I have provided an initial patch that has pretty much zero testing from the 1.1 release. It would also be useful if the workflow module provided this action template...which I'm also working on and will provide the patch when complete.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | workflow_1.diff | 9.01 KB | chewblocka |
| workflow_0.diff | 2.63 KB | chewblocka |
Comments
Comment #1
chewblocka commentedOkay, I have completed the above mentioned work and attached a diff between the 1.1 released version and my new version. The new action for scheduling a transition in the future works great for an Offset time. I have not tested the specific time. I don't see much use of that but added it just in case someone wanted it.
Comment #2
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