Recently, while working on a WCM project, I realized that many developers don't know that various properties of a list item (especially document library) are inter dependent and may change based on each other's values. These properties are: Moderation (Approval) status, Scheduling status, Versions Numbers. So I thought, I'd put up this write-up that would demystify some of the underlying concepts.
Before starting on this let's get some facts clear:
Item.ModerationInformation.Status = SPModerationStatusType.Approved
SharePoint provides multiple ways to approve or publish items that can vary based on item's moderation status and version numbers. This section explains that. Note that the following explanation is only for "Pages" library in "Publishing Sites". However, the behavior should be same for other document libraries also, though Page Editing Toolbar would not be available.
The options to approve based on moderation status are:
The behavior of various options is described below. To make it simpler to understand, I've provided the following categories for each behavior:
The behavior for options is: