Skip to content

Commit

Permalink
Merge pull request #11148 from umbraco/v9/bugfix/11083-nested_content…
Browse files Browse the repository at this point in the history
…_missing_properties_on_member_edit

V9/bugfix/11083 nested content missing properties on member edit
  • Loading branch information
bergmania authored Sep 21, 2021
2 parents 6c1ced2 + a7d60ba commit e84f4b2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System.Collections.Generic;
using System.Linq;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.Web.BackOffice.Controllers;
using Umbraco.Cms.Web.Common.Attributes;
Expand All @@ -23,9 +24,7 @@ public NestedContentController(IContentTypeService contentTypeService)
}

[HttpGet]
public IEnumerable<object> GetContentTypes()
{
return _contentTypeService
public IEnumerable<object> GetContentTypes() => _contentTypeService
.GetAllElementTypes()
.OrderBy(x => x.SortOrder)
.Select(x => new
Expand All @@ -35,8 +34,7 @@ public IEnumerable<object> GetContentTypes()
name = x.Name,
alias = x.Alias,
icon = x.Icon,
tabs = x.CompositionPropertyGroups.Select(y => y.Name).Distinct()
tabs = x.CompositionPropertyGroups.Where(x => x.Type == PropertyGroupType.Group && x.GetParentAlias() is null).Select(y => y.Name).Distinct()
});
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@
// remove all tabs except the specified tab
var tabs = scaffold.variants[0].tabs;
var tab = _.find(tabs, function (tab) {
return tab.id !== 0 && (tab.alias.toLowerCase() === contentType.ncTabAlias.toLowerCase() || contentType.ncTabAlias === "");
return tab.id !== 0 && (tab.label.toLowerCase() === contentType.ncTabAlias.toLowerCase() || contentType.ncTabAlias === "");
});
scaffold.variants[0].tabs = [];
if (tab) {
Expand Down

0 comments on commit e84f4b2

Please sign in to comment.