April 11, 2012 Leave a comment
When moving a CMS page to a subfolder on a Pages library using the Manage Content and Structure tool, the Content Managers were getting the following error:
System.ArgumentException – 0x80070057
at Microsoft.SharePoint.Library.SPRequestInternalClass.GetMetadataForUrl(String bstrUrl, Int32 METADATAFLAGS, Guid& pgListId, Int32& plItemId, Int32& plType, Object& pvarFileOrFolder)
at Microsoft.SharePoint.Library.SPRequest.GetMetadataForUrl(String bstrUrl, Int32 METADATAFLAGS, Guid& pgListId, Int32& plItemId, Int32& plType, Object& pvarFileOrFolder)
at Microsoft.SharePoint.SPWeb.GetFileOrFolderObject(String strUrl)
at Microsoft.SharePoint.Publishing.CommonUtilities.GetFileFromUrl(String url, SPWeb web)
at Microsoft.SharePoint.Publishing.Internal.DeploymentWrapper.cachePageInfoForXmlFiltering(PublishingPage publishingPage)
at Microsoft.SharePoint.Publishing.Internal.DeploymentWrapper.configureExportCopyOrMove(String sourceSmtObjectIds, SPExportSettings& exportSettings, SPIncludeVersions versionsToInclude)
at Microsoft.SharePoint.Publishing.Internal.DeploymentWrapper.MoveItems(String sourceSmtObjectIds, String destSmtObjectId)
Operation to Move PageName.aspx to /Pages/SubFolder failed
After a little bit of research/thinking (yes, it doesn’t hurt a lot as some people imagine….lol) I recalled this site had been restored from a SharePoint farm in a different environment. So there was a chance the reference to the page layout was still pointing to the web application’s URL of the previous environment.
In the case I used the Repair-SPPageLayout cmdlet to fix all the references to page layouts. The syntax is:
Get-SPWebApplication “http://webapplicationurl” | Repair-SPPageLayoutUrl
This command repaired all the content pages which were not checked out. Then I tried the moving operation again and it succeeded.