Tuesday 22 September 2015

The site is not valid. The 'Pages' document library is missing.

Whenever users try to deactivate and then activate the SharePoint server publishing feature on a publishing website, there are chances where the pages list ID get changed and give us the below error

Error: 

The site is not valid. The 'Pages' document library is missing.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: Microsoft.SharePoint.Publishing.InvalidPublishingWebException: The site is not valid. The 'Pages' document library is missing.

How to fix the problem?

To fix the issue it is required to update the value of the __PagesListId property value to match the ID of the Pages library.

This can be done through the following Powershell script:

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

No comments:

Post a Comment