nathanwoulfe / Plumber

The workflow solution for Umbraco 7
39 stars 20 forks source link

Workflow with a Schedule At date publishes content right away #108

Closed williamOng closed 5 years ago

williamOng commented 5 years ago

When a publish date is set, the workflow does not set a scheduled publish. Instead, it publishes the changes right away. Unpublish date sent somehow is still saved.

Steps to reproduce the behavior:

  1. Go to a content
  2. Set a publish and unpublish date
  3. Go through the workflow
  4. Proceed to approving and publishing

Expected behavior Workflow is completed with the publish date saved.

Plumber version v1.1.8

At a glance, it seems like in WorkflowProcess.cs, the Instance.SetScheduledDate(); set in ActionWorkflow should be set before CompleteWorkflow(); is called. CompleteWorkflow uses the Instance to determine whether it has a scheduled date or not, but since it isn't set before, it will always call HandlePublishNow().

I don't know whether the correct fix is to put it before the CompleteWorkflow() call or not, or if there's some other issue with the instances.

Thanks,

immych commented 5 years ago

Have been having the same issue as well.

nathanwoulfe commented 5 years ago

@williamOng thanks for looking into it, that sounds like it would be the cause. Will fix it today.

nathanwoulfe commented 5 years ago

Fixed in 1.1.9