When creating or editing an unpublished node, you are able to set a publishing date and also set the moderation state to published (or whatever your scheduler_publish_moderation_state_type is). Upon doing so, the scheduler module sees the $node->publish_on property and explicitly sets $node->status = 0 (see scheduler_node_presave()). Since the moderation state behaviour is specific to workbench, I think this is best handled in this module with an additional presave hook that runs after scheduler.
There's still the issue of the scheduler message displaying, the only way I can see this could possibly be stopped is if the _scheduler_allow() function took $node as a reference so we were able to hook into that and unset the publish_on property but for now this works :)
Patch attached.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | scheduler-workbench-publish-state-with-scheduled-publishing-2.patch | 1.45 KB | acbramley |
Comments
Comment #1
acbramley commentedBump and new patch to fix and issue where scheduling a node that wasn't using workbench_moderation would always pass the condition therefore never allowing a published stamp to be saved.
Comment #2
istryker commentedLooks like your patch works, however I do not think this is something this module should patch. This is a problem with the scheduler module where it allows you save a node with a publish_on date and publish/status set to 1.
Over 6 months have pass so you may be getting different results now, as Scheduler module has changed. I tested saving a node with publish date and published state, as well as, saving a node with a publish date and unpublish state, then publishing it right after. When you run cron, the node remains published. There is a state change from Published to Published, which shouldn't happen, but thats a scheduler module problem. (There problem as the node should not be resaved and/or new revision being created).
Also tested this with "Create a new revision on publish" checked and unchecked.
I have updated #747536: Allow manual changes to "Published" status if a node is scheduled for publishing issue in Scheduler issue queue. Hopefully they will solve the answer there.
Marking as Closed (won't fix). Would be nice if the module maintainer jump in and agrees (or disagree).