Second Life of a Hungarian SharePoint Geek

July 12, 2013

Documents keeping their moderation status even after content approval was turned off

Filed under: SP 2010 — Tags: — Peter Holpar @ 22:24

You probably know, that SharePoint document libraries with content approval provide a special view called Approve / reject items.



This view helps users to review the approval status of the documents, without opening the display / edit form of each document.


A few weeks ago I was to create a similar aggregation on the site level using the Content Query Web Part. I used the following custom CAML query to get the list of documents waiting for approval (see the possible value of the corresponding SPModerationStatusType enumeration here):

<Where><Eq><FieldRef Name="_ModerationStatus" /><Value Type="ModStat">2</Value></Eq></Where>

Without delving too deep into further details of implementation, I want to share this time a very strange discovery. In the list of the displayed documents (that should be the list of pending documents) appeared a few documents from a library where the content approval was turned off. At first look it seems to be a bug, however it has a rational reason: the content approval was formerly activated on the library, but later it was deactivated. Documents in the library kept their actual moderation status (value of the hidden _ModerationStatus field is not deleted), that means, after a possible re-activation the original status would be easily recovered.

Minor side-effect for me, that due to this feature my site query does not produce the expected results.


Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at

%d bloggers like this: