This patch adds two features and fixes one bug that widen the range of ways third party modules can integrate with Scheduler;
- Implementations of
hook_scheduler_api()can now receive$nodeby reference. hook_scheduler_api()is now also invoked before publishing and unpublishing with "pre_publish" and "pre_unpublish" actions respectively.- BUG: The
$nodeobject still haspublish_onandunpublish_onproperties whenactions_do()is called. This causes the value to be saved to the database again if any module that does an asynchronousnode_save()with the$nodeobject.
These API features are useful and/or required by Scheduler Workbench Integration module to effectively integrate Scheduler with Workbench Moderation module. Specifically;
scheduler_workbench_scheduler_api()can trigger moderation-state changes via the$node->workbench_moderation_state_newproperty, which is more reliable, thorough and efficient than callingworkbench_moderation_moderate()after the node is already published by scheduler. It also means that the node only passes through one moderation state transition instead of two.- Workbench Moderation has a
drupal_register_shutdown_function()-callback whichnode_save()s as drupal shuts down, restoringpublish_onandunpublish_ondates to theschedulertable.
Related patch for Scheduler Workbench Integration module; #1660252: Publishing transitions twice through draft
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | 1660192-6-scheduler-external_integration.patch | 1.59 KB | pfrenssen |
| #5 | 1660192-expand-options-03.patch | 1.57 KB | xtfer |
| #4 | scheduler-external_integration-1660192.patch | 1.26 KB | rv0 |
| #1 | more_integration_options.patch | 1.64 KB | Bevan |
Comments
Comment #1
Bevan commentedComment #2
Bevan commentedThis patch does not fix the bug in the case where both the publish and unpublish events for a node happen on the same cron run. I can not think of a fix for that scenario that is sufficiently unhacky to be worth contributing, without overhauling
scheduler_cron().Comment #3
acbramley commentedThis patch fixed an issue for me where the workbench state wasn't being set correctly on with scheduler_workbench
Comment #4
rv0 commented+1 for getting this committed.
one comment:
objects are always passed by reference so the "&" is not needed
repost with those lines removed:
Comment #5
xtfer commentedThe patch in #4 wouldn't apply for me. Kept telling me it was corrupt.
I've just rerolled it as is to try to fix that.
Comment #6
pfrenssenRerolled patch to latest dev and improved documentation.
Comment #7
rickmanelius commentedI'm slightly confused by the comment in #4. It was stated that & is not needed and then it's still in the patch.
Otherwise it looks good and will be committed once we can get clarification on this point.
Comment #8
pfrenssen@rickmanelius, that comment was about this hunk in the patch in #1. It was removed in #4 and subsequent patches:
Comment #9
rickmanelius commented@pfrenssen Dreditor must have been playing tricks on me because I can see the difference now. I'll get this applied tonight.
Comment #10
rickmanelius commentedJust committed #6. Thanks to everyone for their help in creating/reviewing this patch.
http://drupalcode.org/project/scheduler.git/commit/0212013
Comment #11.0
(not verified) commentedAdding reference to the patch that requires this