From e56ad2d312ede81537958f32bbda393f4bc6de80 Mon Sep 17 00:00:00 2001 From: Stephan Date: Thu, 17 Jan 2019 13:43:17 +0100 Subject: [PATCH 1/3] Fix migration from 7.14 --- .../V_7_14_0/UpdateMemberGroupPickerData.cs | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/Umbraco.Core/Migrations/Upgrade/V_7_14_0/UpdateMemberGroupPickerData.cs b/src/Umbraco.Core/Migrations/Upgrade/V_7_14_0/UpdateMemberGroupPickerData.cs index 516af5c0fc..c70f42076f 100644 --- a/src/Umbraco.Core/Migrations/Upgrade/V_7_14_0/UpdateMemberGroupPickerData.cs +++ b/src/Umbraco.Core/Migrations/Upgrade/V_7_14_0/UpdateMemberGroupPickerData.cs @@ -10,21 +10,20 @@ /// public UpdateMemberGroupPickerData(IMigrationContext context) : base(context) - { - } + { } public override void Migrate() { - Database.Execute($@"UPDATE cmsPropertyData SET dataNtext = dataNvarchar, dataNvarchar = NULL - WHERE dataNtext IS NULL AND id IN ( - SELECT id FROM cmsPropertyData WHERE propertyTypeId in ( - SELECT id from cmsPropertyType where dataTypeID IN ( - SELECT nodeId FROM cmsDataType WHERE propertyEditorAlias = '{Constants.PropertyEditors.Aliases.MemberGroupPicker}' + Database.Execute($@"UPDATE umbracoPropertyData SET textValue = varcharValue, varcharValue = NULL + WHERE textValue IS NULL AND id IN ( + SELECT id FROM umbracoPropertyData WHERE propertyTypeId in ( + SELECT id from cmsPropertyType where dataTypeId IN ( + SELECT nodeId FROM umbracoDataType WHERE propertyEditorAlias = '{Constants.PropertyEditors.Aliases.MemberGroupPicker}' ) ) )"); - Database.Execute($"UPDATE cmsDataType SET dbType = 'Ntext' WHERE propertyEditorAlias = '{Constants.PropertyEditors.Aliases.MemberGroupPicker}'"); + Database.Execute($"UPDATE umbracoDataType SET dbType = 'Ntext' WHERE propertyEditorAlias = '{Constants.PropertyEditors.Aliases.MemberGroupPicker}'"); } } } From 2eabdbb55b94a04edf453dd59bb94baf985a1dda Mon Sep 17 00:00:00 2001 From: Stephan Date: Thu, 17 Jan 2019 14:19:52 +0100 Subject: [PATCH 2/3] Improve PublishedModelFactory error message on collisions --- .../Models/PublishedContent/PublishedModelFactory.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Umbraco.Core/Models/PublishedContent/PublishedModelFactory.cs b/src/Umbraco.Core/Models/PublishedContent/PublishedModelFactory.cs index ee3fd62985..2528f7c3fd 100644 --- a/src/Umbraco.Core/Models/PublishedContent/PublishedModelFactory.cs +++ b/src/Umbraco.Core/Models/PublishedContent/PublishedModelFactory.cs @@ -68,7 +68,7 @@ namespace Umbraco.Core.Models.PublishedContent var typeName = attribute == null ? type.Name : attribute.ContentTypeAlias; if (modelInfos.TryGetValue(typeName, out var modelInfo)) - throw new InvalidOperationException($"Both types {type.FullName} and {modelInfo.ModelType.FullName} want to be a model type for content type with alias \"{typeName}\"."); + throw new InvalidOperationException($"Both types {type.AssemblyQualifiedName} and {modelInfo.ModelType.AssemblyQualifiedName} want to be a model type for content type with alias \"{typeName}\"."); // have to use an unsafe ctor because we don't know the types, really var modelCtor = ReflectionUtilities.EmitConstructorUnsafe>(constructor); From 650f668edbfb33799e623bcd7b2382abf19307ae Mon Sep 17 00:00:00 2001 From: Stephan Date: Thu, 17 Jan 2019 14:21:35 +0100 Subject: [PATCH 3/3] Improve PublishedModelFactory error message on collisions --- .../Models/PublishedContent/PublishedModelFactory.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Umbraco.Core/Models/PublishedContent/PublishedModelFactory.cs b/src/Umbraco.Core/Models/PublishedContent/PublishedModelFactory.cs index 2528f7c3fd..8be56850d1 100644 --- a/src/Umbraco.Core/Models/PublishedContent/PublishedModelFactory.cs +++ b/src/Umbraco.Core/Models/PublishedContent/PublishedModelFactory.cs @@ -68,7 +68,7 @@ namespace Umbraco.Core.Models.PublishedContent var typeName = attribute == null ? type.Name : attribute.ContentTypeAlias; if (modelInfos.TryGetValue(typeName, out var modelInfo)) - throw new InvalidOperationException($"Both types {type.AssemblyQualifiedName} and {modelInfo.ModelType.AssemblyQualifiedName} want to be a model type for content type with alias \"{typeName}\"."); + throw new InvalidOperationException($"Both types '{type.AssemblyQualifiedName}' and '{modelInfo.ModelType.AssemblyQualifiedName}' want to be a model type for content type with alias \"{typeName}\"."); // have to use an unsafe ctor because we don't know the types, really var modelCtor = ReflectionUtilities.EmitConstructorUnsafe>(constructor);