More in this section

Forums / General Discussions / Cannot Edit Template: Cyclic child/parent Error

Cannot Edit Template: Cyclic child/parent Error

8 posts, 0 answered
  1. Jorge
    Jorge avatar
    40 posts
    Registered:
    27 Apr 2011
    05 May 2011
    Link to this post
    I've been working on this site and just went in to fine tune the main template and now I keep getting this error:
    "Cyclic child/parent relationship. A control/layout cannot be the parent of its own parent."

    I did not make ANY changes to it after the last time I published it.
    I just went back to it and started getting this error.
    I can edit it's title, permissions, everything except the actual content.
    It is derived from one of the stock templates, I see no self referencing in the UI.

    Is there any way to roll back the version?

    Please help if you've hit this, thanks!  
  2. Jorge
    Jorge avatar
    40 posts
    Registered:
    27 Apr 2011
    05 May 2011
    Link to this post
    Here's the entire trace.

    ---------------

    Cyclic child/parent relationship. A control/layout cannot be the parent of its own parent.

    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.IO.InvalidDataException: Cyclic child/parent relationship. A control/layout cannot be the parent of its own parent.

    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:

    [InvalidDataException: Cyclic child/parent relationship. A control/layout cannot be the parent of its own parent.]
       Telerik.Sitefinity.Modules.Pages.PageHelper.AssertNotCyclic(ControlData ctrl, ControlData parent) +208
       Telerik.Sitefinity.Modules.Pages.PageHelper.SortControls(IEnumerable`1 controlContainers, Int32 count) +780
       Telerik.Sitefinity.Modules.Pages.PageHelper.ProcessControls(IList`1 controls, IList`1 placeholders, IList`1 controlContainers) +105
       Telerik.Sitefinity.Modules.Pages.TemplateDraftProxy..ctor(TemplateDraft pageData, PageDataProvider provider, Boolean isPreview) +890
       Telerik.Sitefinity.Modules.Pages.TemplateEditorRouteHandler.GetPageData(SiteMapNode node) +1130
       Telerik.Sitefinity.Web.RouteHandler.GetHttpHandler(RequestContext requestContext) +157
       System.Web.Routing.UrlRoutingModule.PostResolveRequestCache(HttpContextBase context) +11340424
       System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +80
       System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +266
    
  3. Jorge
    Jorge avatar
    40 posts
    Registered:
    27 Apr 2011
    06 May 2011
    Link to this post
    hey folks,
    I need to escalate late this.  If anyone knows please chime in.

    If it cannot be resolved I need to start on recreating the templates ASAP. 
  4. Jorge
    Jorge avatar
    40 posts
    Registered:
    27 Apr 2011
    06 May 2011
    Link to this post
    This is now happening to all assets, pages, templates etc. throw this error on edit and preview.
    So do all prior versions, when we go into Revision History to find the last good version, they all blow up with this error when the version number is clicked to preview.
    Now the entire project cannot be edited or previewed.

    I tried creating a new template and a new page, very simple, but as soon as I save and publish, I cannot open them again and get that same Cyclic child/parent Error.

    If anyone knows how to fix this please let us know, the entire site has broken.
  5. Jorge
    Jorge avatar
    40 posts
    Registered:
    27 Apr 2011
    06 May 2011
    Link to this post
    Now even the live published site, which worked yesterday, throws this error.
    All the published pages break and we didn't even change them.
  6. Jorge
    Jorge avatar
    40 posts
    Registered:
    27 Apr 2011
    06 May 2011
    Link to this post
    now it is happening in the login page too.
  7. Lyubomir Dokov
    Lyubomir Dokov avatar
    43 posts
    Registered:
    06 Jun 2017
    11 May 2011
    Link to this post

    Hi Jorge,

    This error happens when you have two widgets on a page/template that reference each other as parents. I don't know how this happened but it is probably in some of your templates, this is why it spreads everywhere.

    What you can do:
    if you can spot the template that causes the problem, you can try to set some things in the database that would fix it. Once you have the id of the template, you can go to sf_object_data table and set the sibling_id to an empty guid (00000000-0000-0000-0000-000000000000). Note, that this will break the ordering of the widgets, you will have to reorder them after that.

    How to spot the template:
    You know the name of the template. You need its id. Go to sf_page_templates table and find it, it is the id column.

    Kind regards,
    Lyubomir Dokov
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  8. Paul
    Paul avatar
    18 posts
    Registered:
    14 Jan 2011
    24 Jan 2012
    Link to this post
    Hi
    We had the same problem with two java script widgets having a cyclic relationship.
    So I wrote the following select query to find all the cyclic objects. In our case it found 3 couplings although we had only one of them causing the crash.

    select

    Wing1.ID, Wing1.sibling_id, Wing1.object_type, Wing1.page_id, Wing1.parent_prop_id, sf_object_data.id,sf_object_data.sibling_id from sf_object_data as Wing1 inner join sf_object_data on Wing1.id = sf_object_data.sibling_id and sf_object_data.id = Wing1.sibling_id

    The following update query will break all the cyclic relationships

     

    update W

     

    ing1

     set Wing1.sibling_id='00000000-0000-0000-0000-000000000000'

     from sf_object_data as Wing1 inner join sf_object_data on Wing1.id = sf_object_data.sibling_id and sf_object_data.id = Wing1.sibling_id


    For none SQL Buffs the joining on the two fields of id and sibling_id for both the alias table and the sf_object_table restrict the result set to only the cyclic objects. Note that each pair will appear twice in the result set.

    I hope this makes it easier for anyone else with this problem

    Paul Hughes

     



8 posts, 0 answered