Monday, November 4, 2013

The SPListItem provided is not compatible with a Publishing Page.


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)


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.AllProperties["__PublishingFeatureActivated"] = "True"

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()

Please validate and enjoy !!!

Please post your feedback or queries related to this.

Sunday, October 6, 2013

Restoring Workflow to Previous Version in SharePoint

Hi All,

Please follow the below steps to restore the previous version of workflow in SharePoint.

1.Open sharepoint designer with the site url where the wirkflow is resided.
2.Goto all files on workflows the required workflow will find the workflowname.XOML file
6.Right click on it -->Version History
7.Select the version you want restore
8.Restore it
9.Do the Same for xoml.wfconfig.xml
10.Then publish the workflow

Hope this helps !

Monday, September 23, 2013

Incoming emails not working after upgrade to SharePoint 2010 from SharePoint 2007

Issue Descriptions : User may reported that incoming emails are not working for SharePoint 2010 list and libraries after upgrade to SharePoint 2010.

Answer: This is kind of known issue. To resolve the issue, follow below steps.

1. Visit incoming email settings page of a list/library.
2. Disable the Incoming Email
3. Save the changes
4. Visit incoming email settings page of a list/library again
5. Enable the Incoming Email and enter the email address
6. Save the changes
7. Test it