From 1a92dbfd8fee30689822a09a57a2365d40c1bc4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20Knippers?= Date: Tue, 15 Oct 2019 09:28:25 +0200 Subject: [PATCH] Properly set / unset Culture flag instead of removing _all_ flags when "Vary by Culture" is false. --- .../Models/Mapping/ContentTypeMapDefinition.cs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/Umbraco.Web/Models/Mapping/ContentTypeMapDefinition.cs b/src/Umbraco.Web/Models/Mapping/ContentTypeMapDefinition.cs index 528d5f6de5..9b8936a43c 100644 --- a/src/Umbraco.Web/Models/Mapping/ContentTypeMapDefinition.cs +++ b/src/Umbraco.Web/Models/Mapping/ContentTypeMapDefinition.cs @@ -223,7 +223,11 @@ namespace Umbraco.Web.Models.Mapping target.DataTypeKey = source.DataTypeKey; target.Mandatory = source.Validation.Mandatory; target.ValidationRegExp = source.Validation.Pattern; - target.Variations = source.AllowCultureVariant ? ContentVariation.Culture : ContentVariation.Nothing; + target.Variations = source.AllowCultureVariant + // Set culture flag + ? target.Variations | ContentVariation.Culture + // Unset culture flag + : target.Variations & ~ContentVariation.Culture; if (source.Id > 0) target.Id = source.Id; @@ -395,9 +399,11 @@ namespace Umbraco.Web.Models.Mapping if (!(target is IMemberType)) { - target.Variations = ContentVariation.Nothing; - if (source.AllowCultureVariant) - target.Variations |= ContentVariation.Culture; + target.Variations = source.AllowCultureVariant + // Set culture flag + ? target.Variations | ContentVariation.Culture + // Unset culture flag + : target.Variations & ~ContentVariation.Culture; } // handle property groups and property types