Problem/Motivation

Revision Scheduler schedules operations on revisions. It would be nice to be able to preview the outcome of this operations with SPS.

Proposed resolution

For now integrate with the node date condition that is shipped with SPS. And limit the preview to publish / unpublish status.
Since revision scheduler allows other modules to provide operations and the outcome of this operations is not "predictable" we need a new hook that can be invoked to figure out if a entity / entity revision is accessible after the operation was fired: hook_entity_revision_operation_result_state()

Remaining tasks

Reviews needed.

User interface changes

None

API changes

New hook to determine the published / unpublished status after processing an operation: hook_entity_revision_operation_result_state()

Original report by @indytechcook

Add a Condition and Override for http://drupal.org/project/revision_scheduler

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

indytechcook’s picture

Version: » 7.x-1.x-dev
Assigned: Unassigned » jec006
jec006’s picture

Workbench doesn't have scheduling in 7.x-1.x - we can base it on : http://drupal.org/project/revision_scheduler if desired. I'm not aware of other schedulers for workbench moderation.

jec006’s picture

Assigned: jec006 » indytechcook
Status: Active » Postponed (maintainer needs more info)
indytechcook’s picture

Status: Postponed (maintainer needs more info) » Active
Issue tags: -lsd-csi sprint 3 +lsd-csi community

Let's put this on hold since it's not part of the projects SOW. I'm removing from this sprint.

indytechcook’s picture

Title: Add a Condition and Override for Workbench scheduling » Add an override and reaction for Revision Scheduler

Updating title.

indytechcook’s picture

Title: Add an override and reaction for Revision Scheduler » Integration with Revision Scheduler
indytechcook’s picture

Issue summary: View changes

Updated issue summary.

das-peter’s picture

Project: Site Preview System » Revision scheduler
Component: Workflow » Code
Assigned: indytechcook » Unassigned
Issue summary: View changes
Status: Active » Needs review
Related issues: +#2022535: Port for workbench_moderation-7.x-2.x-dev, +#2130237: Integrate with State Flow Schedule / Revision Scheduler
FileSize
7.59 KB

I just worked on this.
Moving to the Revision scheduler queue because some changes there are necessary to make this fully pluggable.
Updated the summary.

das-peter’s picture

Title: Integration with Revision Scheduler » Integration with SPS (Site Preview System)

Changing title :D

Dave Reid’s picture

Dave Reid’s picture

Would be good to also get some review on #2364585: Implement entity revision operations as plugins as it might make sense instead of this new hook, to have it be a new method in the operation plugin class.

ericduran’s picture

I'm ok deprecating my module in favor of the patch here.

A couple of difference between my module and the patch here which I'm curious about.

In this patch a lot of logic is happening in the processOverrides ex:

+++ b/lib/Drupal/revision_scheduler/RevisionSchedulerNodeDateOverride.php
@@ -0,0 +1,66 @@
+        $entity = revision_scheduler_entity_revision_load($operation->entity_type, $operation->entity_id, $operation->revision_id);
+
+        // Check the state the entity would have after processing the operation.
+        $result_state = module_invoke_all('entity_revision_operation_result_state', $operation, $entity);

These seems weird here, we can move the logic in getOverrides so that it only returns items we care about. Also removes the extra for loop with the module invoke in it.