Showing posts with label Publishing Feature in SharePoint 2010. Show all posts
Showing posts with label Publishing Feature in SharePoint 2010. Show all posts

Monday, November 4, 2013

The SPListItem provided is not compatible with a Publishing Page.

Scenario:

I have a SharePoint 2010 site collection with publishing feature enabled. I am able to check-out pages but not able to check-in pages. Below is the error during check-in.

"An unexpected error has occurred" with Correlation Id.

Actual Error in LOG File:

System.ArgumentException: Invalid SPListItem. The SPListItem provided is not compatible with a Publishing Page.    at Microsoft.SharePoint.Publishing.PublishingPage.GetPublishingPage(SPListItem sourceListItem)     at Microsoft.SharePoint.Publishing.Internal.WebControls.PublishingPageStateControl.RaisePostBackEventForPageRouting(String eventArgument, SPRibbonCommandHandler control, RaisePostBackEventDelegate raisePostBackEventDelegate)     at Microsoft.SharePoint.Publishing.Internal.WebControls.PublishingPageCheckinHandler.RaisePostBackEvent(String eventArgument)     at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)     at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

Resolution:

First try to Deactivate and ReActivate the Sharepoint Site Publishing Infrastructure feature at both Scopes (Site And Web) level.

If this will not solve your problem then try to run following Power shell script.

$web = get-spweb "http://site-collection/path-to-affected-site"
$correctId = $web.Lists["Pages"].ID
$web.AllProperties["__PagesListId"] = $correctId.ToString()
$web.Update()
$web.AllProperties["__PublishingFeatureActivated"] = "True"
$web.Update()

That's it.... Enjoy with the solution.... Please provide your feedback if this post is helpful to you....



Wednesday, October 23, 2013

The site is not valid. The 'Pages' document library is missing. - SharePoint 2010

Recently I was involved in upgrading SharePoint sites from MOSS 2007 SharePoint 2010. After upgrade found that user is not able to create new pages in Page library of publishing sites. But this issue was not present in MOSS 2007. Below is the details on how I resolved the issue.

Issue Description :
I try to create new page in Pages library and it throw an error message with correlation id. Then I looked into log file and below error was associated with correlation id.

Microsoft.SharePoint.Publishing.InvalidPublishingWebException: The site is not valid. The 'Pages' document library is missing.

Root Cause :
 - Publishing Feature is not activated
 - The value stored in "__PageListId" property bag is not same as the actual page library list id

Solution :
 - Make sure publishing feature is active
 - Try to de-activate and re-activate the publishing feature if you see the publishing feature is showing active
 - Run the following PowerShell script to fix the inconsistency of the actual Pages library and try to de-activate and re-activate the publishing feature again.

$web = get-spweb "Affected Site URL"
$correctId = $web.Lists["Pages"].ID
$web.AllProperties["__PagesListId"] = $correctId.ToString()
$web.Update()

Please validate and enjoy !!!

Please post your feedback or queries related to this.