Fixes initial tree loading to ensure it gets passed the right culture params, puts any non-translated variant name in brackets in the tree

This commit is contained in:
Shannon
2018-08-17 00:50:05 +10:00
parent 3fac749b38
commit 5324e0fc59
2 changed files with 15 additions and 9 deletions

View File

@@ -178,10 +178,7 @@ namespace Umbraco.Web.Trees
return nodeMenu;
}
protected override UmbracoObjectTypes UmbracoObjectType
{
get { return UmbracoObjectTypes.Document; }
}
protected override UmbracoObjectTypes UmbracoObjectType => UmbracoObjectTypes.Document;
/// <summary>
/// Returns true or false if the current user has access to the node based on the user's allowed start node (path) access
@@ -280,13 +277,19 @@ namespace Umbraco.Web.Trees
// we are getting the tree for a given culture,
// for those items that DO support cultures, we need to get the proper name, IF it exists
// otherwise, invariant is fine
// otherwise, invariant is fine (with brackets)
if (docEntity.Variations.VariesByCulture() &&
docEntity.CultureNames.TryGetValue(culture, out var name) &&
!string.IsNullOrWhiteSpace(name))
if (docEntity.Variations.VariesByCulture())
{
entity.Name = name;
if (docEntity.CultureNames.TryGetValue(culture, out var name) &&
!string.IsNullOrWhiteSpace(name))
{
entity.Name = name;
}
else
{
entity.Name = "(" + entity.Name + ")";
}
}
if (string.IsNullOrWhiteSpace(entity.Name))