Is is possible to perform autopublish of item on intermediate, not final state of sitecore workflow?
Sitecore 9.0.1, Admin user.
I have custom workflow with the following states:
- Editing
- Submit
- Reviewing
- Approve (autopublish item to web database)
- Auto Publish Action
- Reject (move item to Editing)
- Approve (autopublish item to web database)
- Published
- Approve (autopublish item to production database)
- Auto Publish Action
- Reject (move item to Editing)
- Approve (autopublish item to production database)
- On Production (final state)
When item goes from Reviewing
-> Published
state (by approval) - it's not being autopublished. It works only from Published
-> On Production
.
I've tried to achieve this by Sitecore.Workflows.Simple.PublishAction
I also tried to wrote custom processor for this and do publish via code:
PublishManager.PublishItem(dataItem, targets, master, isDeep, false, publishRelated);
or
var po = new PublishOptions(master,
targetDb,
PublishMode.SingleItem,
lang,
System.DateTime.Now);
po.RootItem = dataItem;
Publisher publisher = new Publisher(po);
publisher.Publish();
Code executes, but nothing publishes, no errors in logs.
Is it even possible?