Make IPublishedContent changes less breaking and more friendly

This commit is contained in:
Stephan
2019-06-06 16:54:00 +02:00
parent c17dbbe141
commit 7fd6bfa163
45 changed files with 481 additions and 454 deletions

View File

@@ -171,12 +171,12 @@ namespace Umbraco.Web.Routing
if (entityContent == null) continue;
// get the default affected cultures by going up the tree until we find the first culture variant entity (default to no cultures)
var defaultCultures = entityContent.AncestorsOrSelf()?.FirstOrDefault(a => a.Cultures.Any())?.Cultures.ToArray()
var defaultCultures = entityContent.AncestorsOrSelf()?.FirstOrDefault(a => a.Cultures.Any())?.Cultures.Keys.ToArray()
?? new[] {(string) null};
foreach (var x in entityContent.DescendantsOrSelf())
{
// if this entity defines specific cultures, use those instead of the default ones
var cultures = x.Cultures.Any() ? x.Cultures : defaultCultures;
var cultures = x.Cultures.Any() ? x.Cultures.Keys : defaultCultures;
foreach (var culture in cultures)
{