U4-4253 - Renaming tabs can cause issues when tab with same name exists on derived document type. 7.x

Created by Alexander Pino 18 Feb 2014, 13:50:22 Updated by Robert Foster 03 Jul 2015, 01:54:01

Is duplicated by: U4-4941

Relates to: U4-5769

Renaming tabs can cause issues when tab with same name exists on derived document type. What I did is I created a tab called 'Data' on one of the derived document types. I than changed the name of a tab 'Content' on the master to 'Data'. I moved the properties on the derived document type to the master's tab (although I think they should have been combined already). Now I deleted the tab on the derived document type. And now I am getting all sorts of errors.

Umbraco.Web.Models.Mapping.TabsAndPropertiesResolver.ResolveCore fails

adding back the tab on the derived document type is causing: umbraco.controls.ContentTypeControlNew.BindDataGenericProperties to fail with "Sequence contains more than one matching element"

Comments

Bruce 29 Apr 2014, 15:13:19

I can replicate this issue. If you have a tab on a parent called "Content" and then add a tab on a child called "Content" (again by renaming an existing tab). This will cause a "Sequence contains more than one matching element" when attempting to edit the page. Umbraco version 7.0.4


Sebastiaan Janssen 19 May 2014, 11:47:32

See U4-4941 - trying to give a tab on a document type the same name as an existing tab gives the same problem.


Robert Foster 23 Jun 2014, 23:36:14

One of our developers created a Content tab on a parent doctype while child doctypes already had a tab of the same name which also caused this error when editing content. No hint of the error until we were editing the content though.


Robert Foster 23 Jun 2014, 23:59:55

Potential fix for this problem (worked for my use case anyway): On line 179 (v 7.1.4) of file Umbraco.Web\Models\Mapping\TabsAndPropertiesResolver.cs change Single to First:

}

            //then we'll just use the root group's data to make the composite tab
            var rootGroup = propertyGroups.First(x => x.ParentId == null);
            aggregateTabs.Add(new Tab<ContentPropertyDisplay>
                {
                    Id = rootGroup.Id,
                    Alias = rootGroup.Name,


Priority: Normal

Type: Bug

State: Obsolete

Assignee:

Difficulty: Normal

Category:

Backwards Compatible: True

Fix Submitted: Inline code

Affected versions: 7.1.4

Due in version:

Sprint:

Story Points:

Cycle: