I know this may be a fringe use case, but I'm working on a site using both Workflow/Actions AND Scheduler. In a nutshell, here's our use case:
* Submitter adds a new node, and has the option of using the Scheduler "publish on" field to indicate that they want it to go live at a later date
* Node remains unpublished and goes into a "Needs review" workflow state
* Reviewer looks at the node and may choose a "Approved" workflow state, which normally triggers the stock 'Publish node' action
The problem is that this will always immediately publish the node, even if the submitter has specified a later date and time per the Scheduler module.
We are not using the "Schedule for state change" section of the workflow form because:
1) The submitter doesn't get to see it
2) The reviewer shouldn't have to manually copy a date from somewhere else
This patch provides two new actions:
* "Publish unless Scheduled": when triggered, checks whether $node->scheduler['publish_on'] is empty; if yes, the node is published immediately. If no, it is left alone.
* "Unpublish unless Scheduled": when triggered, checks whether $node->scheduler['unpublish_on'] is empty; if yes, the node is unpublished immediately. If no, it is left alone.
The patch also provides installer update/uninstall functions to add/remove the new actions to the actions_registry table.
| Comment | File | Size | Author |
|---|---|---|---|
| scheduler_actions_publish.patch | 3.74 KB | usonian |
Comments
Comment #1
skiminki commentedHmmh... I tried this patch but the actions didn't get visible in actions menus. What version of actions-module is this patch for? I'm willing to include this in a future release, if I can see it working.
Comment #2
skiminki commentedComment #3
usonian commentedHmm, did you run /update.php as user 1 after applying the patch?
Comment #4
skiminki commentedThat was the first thing I did after applying ;) Then I installed workflow-module and saw that its actions went to the list as they should.
I'm not too familiar with actions module, but I noticed that workflow-module has function workflow_action_info(), which seems to declare the actions. This patch doesn't have that but instead functions prefixed with action_scheduler_ . That's why I suspect different major version. I tried 5.x-2.3.
(Just to remind me later: there's a typo in function name schedules_uninstall.)
Comment #5
eric-alexander schaefer commentedIs this still an issue?
Comment #6
skiminki commentedI'd suspect not. Anyways, I couldn't get the patch working. I didn't inspect this issue too deeply, but I'd say that the patch wasn't for workflow version 2.3, but probably version 1.x.
Comment #7
eric-alexander schaefer commentedI like the idea of this. It might prove usefull later, so I am not closing it.
Comment #8
eric-alexander schaefer commentedusonian, is this still relevant?
Comment #9
eric-alexander schaefer commented