+1-888-365-2779
Try Now
More in this section

Forums / Bugs & Issues / Problem with editing pages in admin panel

Problem with editing pages in admin panel

4 posts, 0 answered
  1. Crusader
    Crusader avatar
    12 posts
    Registered:
    28 Oct 2009
    23 Mar 2010
    Link to this post
    Hello.
    My Sitefinity version is 3.7. My site using one database with another application (not Sitefinity). And i have next problems with editing pages in admin panel. I have creating some pages. But in the Site map tree it shows with lock (attached sitemap.jpg). When i choosed this page it shows next error message under the breadcrumb (attached header.jpg) and as you can see "Edit this page" button isn't active. When i click "Save changes" it shows error page:
    Server Error in '/' Application.
    An object with the same primary key already exists in the cache.
    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: Nolics.ORMapper.Base.NolnetException: An object with the same primary key already exists in the cache.
     
    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:
     
    [NolnetException: An object with the same primary key already exists in the cache.]
       Nolics.ORMapper.Base.OdbClassHelper.CreateClass(IOdbClass cl, Transaction tran, OdbDataProvider provider, ObDataCache cache, OdbObjectStates& state, OdbDataProvider& curProvider, ObDataCache& curCache) +595
       Telerik.Cms.Data.CmsControlProperty.Create(Transaction tran, OdbDataProvider provider, ObDataCache cache) +51
       Nolics.ORMapper.Base.Transaction.Create(IOdbClass mem, OdbDataProvider provider) +27
       Telerik.Cms.Data.CmsControlProperty.Copy(CmsControlProperty source, CmsControlProperty target, Transaction tran) +107
       Telerik.Cms.Data.WebControlBase.Copy(WebControlBase source, WebControlBase target) +202
       Telerik.Cms.Data.CmsWebControl.Copy(CmsWebControl source, CmsWebControl target) +58
       Telerik.Cms.Data.CmsWebControl.Copy(Transaction tran) +68
       Telerik.Cms.Data.StagedPage.Copy(StagedPage source, PageContentBase target) +557
       Telerik.Cms.Data.StagedPage.Publish() +216
       Telerik.Cms.Data.StagedPage.CheckIn() +400
       Telerik.Cms.Web.UI.PageEditorBase.UnlockBtn_Command(Object sender, CommandEventArgs e) +81
       System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e) +108
       System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument) +135
       System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
       System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
       System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +175
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565
     
     
    Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053

    When i try to click "Cancel changes" i get error:
    Server Error in '/' Application.
    Only new or loaded objects can be removed.
    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: Nolics.ORMapper.Base.NolnetException: Only new or loaded objects can be removed.
     
    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:
     
    [NolnetException: Only new or loaded objects can be removed.]
       Nolics.ORMapper.Base.OdbClassHelper.DeleteClass(IOdbClass cl, OdbObjectStates& state) +444
       Telerik.Cms.Data.CmsControlProperty.Delete() +27
       Telerik.Cms.Data.WebControlBase.DeleteObject() +132
       Telerik.Cms.Data.CmsWebControl.DeleteObject() +41
       Nolics.ORMapper.Base.OdbClassHelper.DeleteClass(IOdbClass cl, OdbObjectStates& state) +80
       Telerik.Cms.Data.WebControlBase.Delete() +27
       Telerik.Cms.Data.StagedPage.DeleteObject() +207
       Nolics.ORMapper.Base.OdbClassHelper.DeleteClass(IOdbClass cl, OdbObjectStates& state) +80
       Telerik.Cms.Data.StagedPage.Delete() +28
       Telerik.Cms.Data.StagedPage.UndoCheckOut() +82
       Telerik.Cms.Web.UI.PageEditorBase.UnlockBtn_Command(Object sender, CommandEventArgs e) +91
       System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e) +108
       System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument) +135
       System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
       System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
       System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +175
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565
     
     
    Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053
    And i cann't delete this page.
    What can you advise me?

    Thanks all.

    Crusader
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    23 Mar 2010
    Link to this post
    Hi Crusader,

    1. Check whether you have another Sitefinity project that is attached to the same database.

    2. You could delete the page programmatically and recreate it. When you are logged in as an administrator, you should be able to get the page and publish it. The administrator has unrestricted permissions over pages and content items.

    • You could try to unlock the page using the code below:

    // create a new instance of CmsManager
    CmsManager cmsManager = new CmsManager();
    // get the node of sitemap that represents the page we will modify
    CmsSiteMapNode nodeForEdit = (CmsSiteMapNode)SiteMap.Provider.FindSiteMapNode("~/Climate.aspx");
    // because we need page associated with transaction, we'll get the page from CmsManager and cast it to ICmsPage
    ICmsPage pageForEdit = cmsManager.GetPage(nodeForEdit.CmsPage.ID, true) as Telerik.Cms.ICmsPage;
    // change property, unlock the page
    pageForEdit.Staged.Locked = false;
    // HERE SET AN USER FROM "ADMINISTRATORS" ROLE AS OWNER OF THE PAGE
    pageForEdit.Owner = "admin";
    // publish the page
    pageForEdit.Publish();

    You have to change FindSiteMapNode with the url to the problematic page.

    • If the above does not help try deleting the page programmatically
    Telerik.Cms.CmsManager cmsManager = new Telerik.Cms.CmsManager();
    Telerik.Cms.Web.CmsSiteMapNode nodeForEdit = (Telerik.Cms.Web.CmsSiteMapNode)SiteMap.Provider.FindSiteMapNode("~/Climate.aspx");
    Telerik.Cms.ICmsPage pageForEdit = cmsManager.GetPage(nodeForEdit.CmsPage.ID, true) as Telerik.Cms.ICmsPage;
    cmsManager.DeletePage(pageForEdit.ID);


    • You can perform some actions against the database and remove the page from there. The table responsible for this flag is sf_StagedPageContent. The owner could be set from sf_CmsPageProps.


    Regards,
    Ivan Dimitrov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. Crusader
    Crusader avatar
    12 posts
    Registered:
    28 Oct 2009
    23 Mar 2010
    Link to this post
    Hi, Ivan Dimitrov

    1. I checked another project that is attached to the same database and it is not Sitefinity. It is custom CMS.
    2. I am logged in as administrator, but when I try to delete page it occured exception:
    Server Error in '/' Application.
    Only new or loaded objects can be removed.
    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: Nolics.ORMapper.Base.NolnetException: Only new or loaded objects can be removed.
     
    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.

    With code of unlock or delete page I have exception on the line:
    pageForEdit = cmsManager.GetPage(nodeForEdit.CmsPage.ID, true) as Telerik.Cms.ICmsPage;
    It shows error message: "Object reference not set to an instance of an object."
    And I haven't access to DB to edit record for this page.
    What do I do wrong?

    Crusader
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    23 Mar 2010
    Link to this post
    Hello Crusader,

    Object reference could be thrown if  nodeForEdit is null. You can attach the code to VS debugger to see which of the objects is actually null. If the node is shown in the SiteMap there should be a record in the database that you could try to delete it. Check sf_PageBase table.

    Kind regards,
    Ivan Dimitrov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Register for webinar
4 posts, 0 answered