Hi Episerver Community, my first post here.
Im programatically saving Content Images (ImageData) with the code:
This saves the Image content sucessfully to a folder where I have setup an Approval Process.
When I save I catch the CheckedInContent event in a InitializableModule and I send an email to a user to Approve this image (this all works fine)
events.CheckedInContent += OnEventCheckedInContent;
However when I go into the CMS, click on the image to approve it I do not get the Approval Process. The status is Ready to Publish and the Publish? button displays Publish Changes when what I want is to go through the Approval Process for this checked in content.
If I call save with Content Images (ImageData) with Default SaveAction as below then I get the correct approval process.
However I have to catch the SavedContent event which kicks of every time content is saved - and I only want 1 approval email sent out. Yes I know I could work around this but Im intersted in the process.
Why is the CheckedInContent save not allowing me to go throug the Approval Process. Is this a bug or a 'featue' of the process?
It could be that something you're doing when saving that's causing the issue. You could listen to the approval events instead and send an email on Started. See the "Hooking up events" guide here: https://world.episerver.com/documentation/developer-guides/CMS/Content/content-approvals/working-with-content-approvals/
And the list of events: https://world.episerver.com/documentation/Class-library/?documentId=cms/11/5455BCCD
I would advise using the SaveAction.RequestApproval which should kick off the approval process for you:
See "Starting an approval" here: https://world.episerver.com/documentation/developer-guides/CMS/Content/content-approvals/working-with-content-approvals/#Startingapproval
By checking in the content you are essentially bypassing the states used in a normal approval flow as described in "Approval flow" here: https://world.episerver.com/documentation/developer-guides/CMS/Content/content-approvals/
I did look at the SaveAction.RequestApproval and I do believe that is what I should be using. However I dismissed it tbecause its a pre-release feature with the comment:
This is a pre-release saveAction that is UNSTABLE and might not satisfy the compatibility requirements as denoted by its associated normal version.
Im very cautious about adding code to a production environment that might not be supported between versions as detailed by Episerver here:
I wonder what are other users experiences wiith these Beta features?
David Knipe your link to the checking in content was helpful thanks.
Approval Sequences should have come out of beta a while back (Episerver CMS v11 I believe) so the error you are seeing may be bug in the documentation and/or you are running an older version of Episerver.
Worth noting you can safely use beta versions of Episerver software, it still goes through a full QA process. The only major difference is that beta versions are not tied to semantic versioining as mentioned here: https://world.episerver.com/blogs/Fredrik-Tjarnberg/Dates/2014/9/Releasing-Beta-Features/