Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

Saving published version with ForceCurrentVersion creates mismatch

Found in

EPiServer.CMS.Core 8.0.0

Fixed in

EPiServer.CMS.Core 9.4.0

(Or a related package)

Created

Nov 02, 2015

Updated

Dec 14, 2015

Area

CMS Core

State

Closed, Fixed and tested


Description

If a published version of a content item is loaded using a content reference with version information then saved with a save action other than Publish (such as, CheckIn or Reject), together with the ForceCurrentVersion flag, those actions create several problems.

  • The version data is modified, but not the published version. That is, if you check the status of the item using the ContentVersionRepository, it has the new status. But if you load the published content version, it is still Published.
  • It does not require Publish access rights, only Edit access.
  • No Publish events are raised, only Save.

This was announced as a breaking change in CMS 8

Saving published content with save action Save and ForceCurrentVersion

Who/what is affected: Check for code using "SaveAction.Save | SaveAction.ForceCurrentVersion"

The expected behavior is that this is not allowed. This is because the current behind-the-scenes upgrading to Publish (added in CMS 7) bypassed the publishing events and access checks and other types of code. You should pass in either Save on versions or Publish to modify a published content without changing status. Calling this combination throws an exception.

http://world.episerver.com/documentation/Items/Upgrading/EPiServer-CMS/8/Breaking-changes/