none
SharePoint Designer: Error when Detaching from page layout - "Value does not fall within expected range"

    Question

  • Hello,

     

    This error is kinda alarming to me since it is occuring on my top-level site's default.aspx page when I try to check it out using SharePoint Designer.  Just like checking out any other page I right click on the page in the Folder List and select Detach from Page Layout... I am then prompted to check to customize it as standard... then check it out.  When I select "Yes" to check it out BLAM:  "Value does not fall within expected range"

     

    No sure how to fix this.  Other site's under the top level site open and detach form the page layout fine. 

     

     

    Wednesday, July 09, 2008 4:29 PM

Answers

  • Ok,


    Let me tell you about the what the situation concluded as and the simple workaround I figured to do around this problem.

     

    Initial problem:  home/pages/default.aspx would not detach from page layout using SPD, but would work fine editing in browser. 

     

    Resolution:  Connect through WebDav connection, point mso: tag to appropriate layout url:

    Code Snippet
    <mso:PublishingPageLayout msdt:dt="String">http://servername/_catalogs/masterpage/defaultlayout.aspx, Welcome Page with Web Part Zones</mso:PublishingPageLayout>

     

     

    not sure exactly how the publishingpagelayout got changed... 

     

    Page detaches fine now, BUT when SPD attempts to open it for customization you receive an message saying there is an unsafe webpart on the page and it cannot be opened contact your administator.  Well, thankfully I am the administrator.

     

    Sooo, to get around this problem I created another page in the same page library with the same webpart zones as default.aspx  and imported all of the web parts on the home page that is not opening correctly.  Once the two pages matched, I swapped them out and works like a charm.

     

    Simple fix to avoid all the hastle trying to cling to a page that can be replicated rather quickly.

     

     

     

    Friday, July 11, 2008 2:58 AM

All replies

  • This is a very generic error and could mean just about anything -- however in the context you describe it often means the metadata associating the page to it's layout is wrong, and it's pointing to a page layout that doesn't exist.

    If you've recently renamed a server, or moved this content from another server (Testing or staging, etc), then this is almost certainly the problem as there are some bugs that leave the old server name in the page layout URL.

    If you think this might apply to you check out Gary Lapointes STSADM extensions - Specifically FixPublishingPagesPageLayout

    http://stsadm.blogspot.com/2007/08/fix-publishing-pages-page-layout-url.html



    Also, you may need to dig into your ULS logs (c:\program files\common files\microsoft shared\web server extensions\12\logs) and see if you can track this down.
    Wednesday, July 09, 2008 5:02 PM
  •  Stefan Keir Gordon wrote:
    This is a very generic error and could mean just about anything -- however in the context you describe it often means the metadata associating the page to it's layout is wrong, and it's pointing to a page layout that doesn't exist.

    If you've recently renamed a server, or moved this content from another server (Testing or staging, etc), then this is almost certainly the problem as there are some bugs that leave the old server name in the page layout URL.

    If you think this might apply to you check out Gary Lapointes STSADM extensions - Specifically FixPublishingPagesPageLayout

    http://stsadm.blogspot.com/2007/08/fix-publishing-pages-page-layout-url.html



    Also, you may need to dig into your ULS logs (c:\program files\common files\microsoft shared\web server extensions\12\logs) and see if you can track this down.

     

    Thanks for your reply, I'm looking through the log files and I'm not seeing anything...

    Wednesday, July 09, 2008 5:27 PM
  • Actually, I take that back:

     

    I found the following error in the log file

     

    Code Snippet

    07/09/2008 10:35:00.52  w3wp.exe (0x0B74)                        0x17E4 CMS                            Publishing                     7oc4 Unexpected PublishingService::AlterPageLayoutConnection - An unhandled exception was thrown: System.ArgumentException: Value does not fall within the expected range.     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.GetMetadataForUrl(String relUrl, Int32 mondoProcHint, Guid& listId, Int32& itemId, Int32& typeOfObject, Object& fileOrFolder)     at Microsoft.SharePoint.SPWeb.GetFileOrFolderObject(String strUrl)     at Microsoft.SharePoint.Publishing.CommonUtilit... 
    07/09/2008 10:35:00.52* w3wp.exe (0x0B74)                        0x17E4 CMS                            Publishing                     7oc4 Unexpected ...ies.GetFileFromUrl(String url, SPWeb web)     at Microsoft.SharePoint.Publishing.PublishingPage.get_Layout()     at Microsoft.SharePoint.Publishing.WebServices.PublishingService.AlterPageLayoutConnection(String pageUrl, Boolean disconnect) 

     

     

    Wednesday, July 09, 2008 5:38 PM

  • So I'll tell you what to try to verify the problem -- It's kinda yucky so bear with me here:

    1. SharePoint designer won't let us see some important parts of your default.aspx page, they hide certain bits for whatever reason. --- So, we have to connect to the database via WebDav to actually get a copy of the page so we can see what the heck is broken.  Windows has the ability to create a webdav connection and show the files like a normal folder by adding a 'network location'.  If you are in vista then right click in your "My Computer" somewhere and add a network location.  If you are in XP/2003 go to network neighorhood and add a 'Network Place/Network Location'. --- Choose the 'custom location' option, and enter the actual web URL to your site.  (http:\\myserver\).
    2. It should create the folder for you, and you should be able to open it and browse the files in your site (actually coming from the database).
    3. You should be able to browse to the correct URL in the folder, most likely just the 'pages' folder, which should have your default.aspx inside it.
    4. Drag the file on to your desktop or somewhere and open it with notepad.
    5. You'll see a bunch of yucky "mso" tags at the top.  This is the good stuff Smile.  There is one called "mso: PublishingPageLayout" with some URL's in it.  Please verify they actually point to the correct server and a page layout that exists -- in fact go make sure you can actually open that layout in sharepoint designer.
    If the layout is set correctly, then something else is wrong Sad.  If it's incorrect we can fix it!  You could, actually edit the text file and drag it back in to fix it.  Or there is a tool we can run to scan all the pages on the site and fix them.

    If you weren't even able to copy the file out, then we have another problem.

    (There are alternative ways to do this, including, I think, some export from designer....)
    • Proposed as answer by kasperlfc Monday, August 16, 2010 1:40 PM
    Wednesday, July 09, 2008 7:02 PM
  •  Stefan Keir Gordon wrote:

    So I'll tell you what to try to verify the problem -- It's kinda yucky so bear with me here:

    1. SharePoint designer won't let us see some important parts of your default.aspx page, they hide certain bits for whatever reason. --- So, we have to connect to the database via WebDav to actually get a copy of the page so we can see what the heck is broken.  Windows has the ability to create a webdav connection and show the files like a normal folder by adding a 'network location'.  If you are in vista then right click in your "My Computer" somewhere and add a network location.  If you are in XP/2003 go to network neighorhood and add a 'Network Place/Network Location'. --- Choose the 'custom location' option, and enter the actual web URL to your site.  (http:\\myserver\).
    2. It should create the folder for you, and you should be able to open it and browse the files in your site (actually coming from the database).
    3. You should be able to browse to the correct URL in the folder, most likely just the 'pages' folder, which should have your default.aspx inside it.
    4. Drag the file on to your desktop or somewhere and open it with notepad.
    5. You'll see a bunch of yucky "mso" tags at the top.  This is the good stuff .  There is one called "mso: PublishingPageLayout" with some URL's in it.  Please verify they actually point to the correct server and a page layout that exists -- in fact go make sure you can actually open that layout in sharepoint designer.

    If the layout is set correctly, then something else is wrong .  If it's incorrect we can fix it!  You could, actually edit the text file and drag it back in to fix it.  Or there is a tool we can run to scan all the pages on the site and fix them.

    If you weren't even able to copy the file out, then we have another problem.

    (There are alternative ways to do this, including, I think, some export from designer....)

     

    Great, I will perform and post update once complete.  Thanks for the help

    Wednesday, July 09, 2008 7:06 PM
  •  

    Ok,

     

    I opened default.aspx in Notepad and found 

     

    Code Snippet

    <mso:PublishingPageLayout msdt:dt="String">http://servername/_catalogs/masterpage/defaultlayout.aspx, Welcome Page with Web Part Zones</mso:PublishingPageLayout>

     

     

     

     

    Then I tried to open this layout using SharePoint Designer and it gave me an invalid URL error.

    So I'm guessing I have to find the correct masterpage layout that is being currently rendered by the page (because currently it is still able to edit using browser and seems to be up and running just fine... so I don't really know why the layout is pointing to a bad url) and replace this with the correct url?

     

    Thanks for the help

    Wednesday, July 09, 2008 7:44 PM
  • Moving the thread to the forum for SPD questions
    Thursday, July 10, 2008 6:47 AM
  • Ok,


    Let me tell you about the what the situation concluded as and the simple workaround I figured to do around this problem.

     

    Initial problem:  home/pages/default.aspx would not detach from page layout using SPD, but would work fine editing in browser. 

     

    Resolution:  Connect through WebDav connection, point mso: tag to appropriate layout url:

    Code Snippet
    <mso:PublishingPageLayout msdt:dt="String">http://servername/_catalogs/masterpage/defaultlayout.aspx, Welcome Page with Web Part Zones</mso:PublishingPageLayout>

     

     

    not sure exactly how the publishingpagelayout got changed... 

     

    Page detaches fine now, BUT when SPD attempts to open it for customization you receive an message saying there is an unsafe webpart on the page and it cannot be opened contact your administator.  Well, thankfully I am the administrator.

     

    Sooo, to get around this problem I created another page in the same page library with the same webpart zones as default.aspx  and imported all of the web parts on the home page that is not opening correctly.  Once the two pages matched, I swapped them out and works like a charm.

     

    Simple fix to avoid all the hastle trying to cling to a page that can be replicated rather quickly.

     

     

     

    Friday, July 11, 2008 2:58 AM