locked
Publishing Page Edit Error RRS feed

  • Question

  • Publishing Site,Custom Page Layout,Custom WebParts (SmartParts)

    We create a New document library and then change its content type to Page.

    2.We create page in this library.

    3.When editing this page ,we go to edit mode.

    4.Whilst saving this page,we get an error

    When i try to edit the page to try to save, now i am getting the below error.

    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: System.ArgumentException: Invalid SPListItem. The SPListItem provided is not compatible with a Publishing Page.

    Source Error:

     

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


    Stack Trace:

    [ArgumentException: Invalid SPListItem. The SPListItem provided is not compatible with a Publishing Page.]
    Microsoft.SharePoint.Publishing.PublishingPage.GetPublishingPage(SPListItem sourceListItem) +303
    Microsoft.SharePoint.Publishing.Internal.WebControls.PublishingPageStateControl.RaisePostBackEventForPageRouting(String eventArgument, SPRibbonCommandHandler control, RaisePostBackEventDelegate raisePostBackEventDelegate) +110
    Microsoft.SharePoint.Publishing.Internal.WebControls.PublishingPageSaveAndStopEditHandler.RaisePostBackEvent(String eventArgument) +134
    System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +29
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2981

    Invalid SPListItem. The SPListItem provided is not compatible with a Publishing Page.

    • Moved by Mike Walsh FIN Monday, August 22, 2011 3:27 PM admin q not general (From:SharePoint - General Question and Answers and Discussion (pre-SharePoint 2010))
    Monday, August 22, 2011 2:08 PM

Answers

  • Publishing pages that depend on Layout pages can only be stored in the regular pages document library.  The pages document library is created with extra code to handle the editing events.  Using a regular document library with the pages content type is not enough.
    Paul Stork SharePoint Server MVP Chief SharePoint Architect: Sharesquared Blog: http://dontpapanic.com/blog Twitter: @pstork
    • Proposed as answer by Bivsworld Monday, August 22, 2011 6:46 PM
    • Marked as answer by Pengyu Zhao Thursday, September 1, 2011 2:01 AM
    Monday, August 22, 2011 3:31 PM
  • I would suggest the following

    1. If the site isn't being exposed to the Internet (which most SharePoint installation aren't) then SEO is relatively meaningless.
    2. There are better ways to overcome the use of /pages in the URL on Internet sites for SEO than hacking the underlying infrastructure.

    So my advice is, don't go looking for trouble.  Talk to your client and tell them that you can't do SharePoint WCM without the /pages library.


    Paul Stork SharePoint Server MVP Chief SharePoint Architect: Sharesquared Blog: http://dontpapanic.com/blog Twitter: @pstork

    • Marked as answer by Pengyu Zhao Thursday, September 1, 2011 2:02 AM
    • Edited by Mike Walsh FIN Friday, September 23, 2011 2:44 PM SP 2010 comment off-topic and thus removed
    Tuesday, August 23, 2011 6:14 PM

All replies

  • Publishing pages that depend on Layout pages can only be stored in the regular pages document library.  The pages document library is created with extra code to handle the editing events.  Using a regular document library with the pages content type is not enough.
    Paul Stork SharePoint Server MVP Chief SharePoint Architect: Sharesquared Blog: http://dontpapanic.com/blog Twitter: @pstork
    • Proposed as answer by Bivsworld Monday, August 22, 2011 6:46 PM
    • Marked as answer by Pengyu Zhao Thursday, September 1, 2011 2:01 AM
    Monday, August 22, 2011 3:31 PM
  • Hi Paul,

     

    Many thanks in taking time to reply. Can you suggest what all other steps to be carried out to avoide Pages Library for storing pages. We have referred this post to do so.

    http://blogs.msdn.com/b/syedi/archive/2008/07/18/why-should-one-save-publishing-pages-in-pages-list-always-in-moss-bend-it.aspx

    Tuesday, August 23, 2011 10:04 AM
  • The point is, as the post suggests, storing publishing pages anywhere other than a pages document library is "breaking the rules".  Just don't do it.  Its not worth the time and trouble to implement the hack suggested by the blog post.  And even if you get it to work your system is now in an "unsupported" state.  I don't ever recommend storing publishing pages elsewhere.  As you have seen it doesn't work.
    Paul Stork SharePoint Server MVP Chief SharePoint Architect: Sharesquared Blog: http://dontpapanic.com/blog Twitter: @pstork
    Tuesday, August 23, 2011 11:48 AM
  • What is the ideal way to implement Directory structor of your choice. Actually the idea is to be able to use these KeyWords in URL for SEO purpose. We can not use /Pages in our URL as client is not allowing us to do so and for this purpose we have bend the Rule. I accept your advice but can you please provide some guidance on how to achieve this?

     

    Thanks in advance.

     

    Anand

    Tuesday, August 23, 2011 2:06 PM
  • I would suggest the following

    1. If the site isn't being exposed to the Internet (which most SharePoint installation aren't) then SEO is relatively meaningless.
    2. There are better ways to overcome the use of /pages in the URL on Internet sites for SEO than hacking the underlying infrastructure.

    So my advice is, don't go looking for trouble.  Talk to your client and tell them that you can't do SharePoint WCM without the /pages library.


    Paul Stork SharePoint Server MVP Chief SharePoint Architect: Sharesquared Blog: http://dontpapanic.com/blog Twitter: @pstork

    • Marked as answer by Pengyu Zhao Thursday, September 1, 2011 2:02 AM
    • Edited by Mike Walsh FIN Friday, September 23, 2011 2:44 PM SP 2010 comment off-topic and thus removed
    Tuesday, August 23, 2011 6:14 PM