Cannot Edit Template: Cyclic child/parent Error
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!
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
Exception Details: System.IO.InvalidDataException: Cyclic child/parent relationship. A control/layout cannot be the parent of its own parent.
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.
[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.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +266
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.
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.
now it is happening in the login page too.
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.
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.
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
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