Cannot Edit Template: Cyclic child/parent Error

Posted by Community Admin on 03-Aug-2018 21:02

Cannot Edit Template: Cyclic child/parent Error

All Replies

Posted by Community Admin on 05-May-2011 00:00

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!  

Posted by Community Admin on 05-May-2011 00:00

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

Posted by Community Admin on 06-May-2011 00:00

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. 

Posted by Community Admin on 06-May-2011 00:00

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.

Posted by Community Admin on 06-May-2011 00:00

Now even the live published site, which worked yesterday, throws this error.
All the published pages break and we didn't even change them.

Posted by Community Admin on 06-May-2011 00:00

now it is happening in the login page too.

Posted by Community Admin on 11-May-2011 00:00

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

Posted by Community Admin on 24-Jan-2012 00:00

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

 



This thread is closed