From 2b14408693d03f3f909d27188b03700a42977b8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20Knippers?= Date: Tue, 15 Oct 2019 11:17:03 +0200 Subject: [PATCH] Revert "Moved property type variation auto correct." This reverts commit 3858bd40adf5fc6c8181c1c8518d41b3e01fd824. --- .../Repositories/Implement/ContentTypeRepository.cs | 10 ---------- .../Implement/ContentTypeRepositoryBase.cs | 10 +++++++++- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/Umbraco.Core/Persistence/Repositories/Implement/ContentTypeRepository.cs b/src/Umbraco.Core/Persistence/Repositories/Implement/ContentTypeRepository.cs index 7c7f39fa54..359b967dab 100644 --- a/src/Umbraco.Core/Persistence/Repositories/Implement/ContentTypeRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/Implement/ContentTypeRepository.cs @@ -287,16 +287,6 @@ 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); diff --git a/src/Umbraco.Core/Persistence/Repositories/Implement/ContentTypeRepositoryBase.cs b/src/Umbraco.Core/Persistence/Repositories/Implement/ContentTypeRepositoryBase.cs index dec5805cf2..2d70e89aa0 100644 --- a/src/Umbraco.Core/Persistence/Repositories/Implement/ContentTypeRepositoryBase.cs +++ b/src/Umbraco.Core/Persistence/Repositories/Implement/ContentTypeRepositoryBase.cs @@ -411,7 +411,15 @@ 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) { - // track each property individually + // 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 if (propertyType.IsPropertyDirty("Variations")) { // allocate the list only when needed