Corrupt system Content Types


I was at a client recently that couldn’t access ANY of their document libraries anymore. New libraries were also affected by this.

The SharePoint ULS logs kept spawning the following error:

10/18/2013 14:11:10.08 w3wp.exe (0x128C) 0x1878 SharePoint Foundation Runtime tkau Unexpected System.NullReferenceException: Object reference not set to an instance of an object. at Microsoft.SharePoint.WebPartPages.ListViewWebPart.PrepareContentTypeFilter(SPList list, Hashtable[] excludedTransformers) at Microsoft.SharePoint.WebPartPages.ListViewWebPart.GenerateDocConvScriptBlock(SPWeb web, SPList list) at Microsoft.SharePoint.WebPartPages.XsltListViewWebPart.OnPreRender(EventArgs e) at Microsoft.SharePoint.WebPartPages.WebPartMobileAdapter.OnPreRender(EventArgs e) at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) 1267cf7d-19e3-4687-a4f3-d4ca48af847c

Digging deeper you can still access List Settings via the following page: http://yoursite/_layouts/mcontent.aspx. Since it seems related to the Content Types I inspected these first. As you can see the Parent Content Type was blank!

Content Type Information

 

Turned out that all of SharePoint’s out of the box “system” Content Types (Item, Document, Folder, …) were missing in the Site Content Type overview.

Final proof was delivered by trying to visit the Content Type Settings of one of these “system” content types: http://yoursite/_layouts/ManageContentType.aspx?ctype=0x0101. This threw an unexpected error.

Solution

These Content Types are made available through a Site Collection Feature called “ctypes”. By reactivating this feature everything was gold again.

Disable-SPFeature -ID 695B6570-A48B-4A8E-8EA5-26EA7 FC1D162 -Url http://yoursite -Confirm:$false
Enable-SPFeature -ID 695B6570-A48B-4A8E-8EA5-26EA7 FC1D162 -Url http://yoursite 
 


Links to this post

Comments

CAPTCHA Image Validation