Moved property type variation auto correct.

This commit is contained in:
Daniël Knippers
2019-10-04 14:28:13 +02:00
parent 2e79a515c9
commit 3858bd40ad
2 changed files with 11 additions and 9 deletions

View File

@@ -287,6 +287,16 @@ namespace Umbraco.Core.Persistence.Repositories.Implement
entity.SortOrder = maxSortOrder + 1;
}
// Update property variations based on the content type variation
foreach (var propertyType in entity.PropertyTypes)
{
// Determine variation for the property type.
// The property is only considered culture variant when the base content type is also culture variant.
// The property is only considered segment variant when the base content type is also segment variant.
// Example: Culture variant content type with a Culture+Segment variant property type will become ContentVariation.Culture
propertyType.Variations = entity.Variations & propertyType.Variations;
}
PersistUpdatedBaseContentType(entity);
PersistTemplates(entity, true);

View File

@@ -411,15 +411,7 @@ AND umbracoNode.id <> @id",
// note: this only deals with *local* property types, we're dealing w/compositions later below
foreach (var propertyType in entity.PropertyTypes)
{
// Update property variations
// Determine target variation of the property type.
// The property is only considered culture variant when the base content type is also culture variant.
// The property is only considered segment variant when the base content type is also segment variant.
// Example: Culture variant content type with a Culture+Segment variant property type will become ContentVariation.Culture
propertyType.Variations = newContentTypeVariation & propertyType.Variations;
// then, track each property individually
// track each property individually
if (propertyType.IsPropertyDirty("Variations"))
{
// allocate the list only when needed