Saving of content as SaveAction.CheckIn skips Approval Process

Brendan Sheehy
Member since: 2018

Hi Episerver Community, my first post here.

Im programatically saving Content Images (ImageData) with the code:

_contentRepository.Save(media, SaveAction.CheckIn);

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)

//In   [InitializableModule]
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.

_contentRepository.Save(media, SaveAction.Default);

Why is the CheckedInContent save not allowing me to go throug the Approval Process. Is this a bug or a 'featue' of the process?

#202092 Mar 13, 2019 18:06