Set culture variation when getting property types for indexing (#14167)

This commit is contained in:
Mole
2023-04-26 14:51:55 +02:00
committed by Zeegaan
parent a45f158d9e
commit d589115b67

View File

@@ -40,6 +40,23 @@ internal abstract class NestedPropertyIndexValueFactoryBase<TSerialized, TItem>
contentType
.PropertyGroups
.SelectMany(x => x.PropertyTypes!)
.Select(propertyType =>
{
// We want to ensure that the nested properties are set vary by culture if the parent is
// This is because it's perfectly valid to have a nested property type that's set to invariant even if the parent varies.
// For instance in a block list, the list it self can vary, but the elements can be invariant, at the same time.
if (culture is not null)
{
propertyType.Variations |= ContentVariation.Culture;
}
if (segment is not null)
{
propertyType.Variations |= ContentVariation.Segment;
}
return propertyType;
})
.ToDictionary(x => x.Alias);
result.AddRange(GetNestedResults(