From c75d4e5b5b1a9f58cf92e07a6f7f2e0804d35279 Mon Sep 17 00:00:00 2001 From: Stephan Date: Fri, 30 Mar 2018 11:00:07 +0200 Subject: [PATCH] Fix post-merge --- .../Migrations/Upgrade/UmbracoPlan.cs | 31 ++++++++++++------- .../Upgrade/V_7_10_0/RenamePreviewFolder.cs | 11 +++---- .../ValueConverters/IntegerValueConverter.cs | 5 --- .../Services/Implement/UserService.cs | 26 +++++----------- src/Umbraco.Core/Umbraco.Core.csproj | 1 + 5 files changed, 32 insertions(+), 42 deletions(-) diff --git a/src/Umbraco.Core/Migrations/Upgrade/UmbracoPlan.cs b/src/Umbraco.Core/Migrations/Upgrade/UmbracoPlan.cs index f8cd4b0f78..a23be132fd 100644 --- a/src/Umbraco.Core/Migrations/Upgrade/UmbracoPlan.cs +++ b/src/Umbraco.Core/Migrations/Upgrade/UmbracoPlan.cs @@ -3,6 +3,7 @@ using System.Configuration; using Semver; using Umbraco.Core.Configuration; using Umbraco.Core.Logging; +using Umbraco.Core.Migrations.Upgrade.V_7_10_0; using Umbraco.Core.Migrations.Upgrade.V_7_5_0; using Umbraco.Core.Migrations.Upgrade.V_7_5_5; using Umbraco.Core.Migrations.Upgrade.V_7_6_0; @@ -50,7 +51,7 @@ namespace Umbraco.Core.Migrations.Upgrade throw new InvalidOperationException("Could not get current version from web.config umbracoConfigurationStatus appSetting."); // must be at least 7.? - fixme adjust when releasing - if (currentVersion < new SemVersion(7, 9)) + if (currentVersion < new SemVersion(7, 10)) throw new InvalidOperationException($"Version {currentVersion} cannot be upgraded to {UmbracoVersion.SemanticVersion}."); // cannot go back in time @@ -90,7 +91,7 @@ namespace Umbraco.Core.Migrations.Upgrade // Update all init-7.x.y chains. - // UPGRADE FROM 7 + // UPGRADE FROM 7, OLDEST // // When upgrading from version 7, the state is automatically set to {init-7.x.y} where // 7.x.y is the version. We need to define a chain starting at that state and taking @@ -100,9 +101,10 @@ namespace Umbraco.Core.Migrations.Upgrade // // fixme adjust when releasing the first public (alpha?) version - // at the moment we don't support upgrading from versions older than 7.9.0 + // we don't support upgrading from versions older than 7.? + // and then we only need to run v8 migrations // - From("{init-7.9.0}"); + From("{init-7.10.0}"); Chain("{7C447271-CA3F-4A6A-A913-5D77015655CB}"); Chain("{CBFF58A2-7B50-4F75-8E98-249920DB0F37}"); Chain("{3D18920C-E84D-405C-A06A-B7CEE52FE5DD}"); @@ -116,14 +118,16 @@ namespace Umbraco.Core.Migrations.Upgrade Chain("{7F59355A-0EC9-4438-8157-EB517E6D2727}"); // must chain to v8 final state (see at end of file) - Chain("{8918450B-3DA0-4BB7-886A-6FA8B7E4186E}"); + Chain("{79591E91-01EA-43F7-AC58-7BD286DB1E77}"); - // 7.9.1, .2, .3 = same as 7.9.0 - // 7.10.0 = same as 7.9.0 - From("{init-7.9.1}").Chain("{init-7.9.0}"); - From("{init-7.9.2}").Chain("{init-7.9.0}"); - From("{init-7.9.3}").Chain("{init-7.9.0}"); - From("{init-7.10.0}").Chain("{init-7.9.0}"); + + // UPGRADE FROM 7, MORE RECENT + // + // handle more recent versions - not yet + + // for more recent versions... + // 7.10.x = same as 7.10.0? + //From("{init-7.10.1}").Chain("{init-7.10.0}"); // VERSION 8 PLAN @@ -192,10 +196,13 @@ namespace Umbraco.Core.Migrations.Upgrade Chain("{2821F53E-C58B-4812-B184-9CD240F990D7}"); Chain("{8918450B-3DA0-4BB7-886A-6FA8B7E4186E}"); + // mergin from 7.10.0 + Chain("{79591E91-01EA-43F7-AC58-7BD286DB1E77}"); + // FINAL STATE - MUST MATCH LAST ONE ABOVE ! // whenever this changes, update all references in this file! - Add(string.Empty, "{8918450B-3DA0-4BB7-886A-6FA8B7E4186E}"); + Add(string.Empty, "{79591E91-01EA-43F7-AC58-7BD286DB1E77}"); } } } diff --git a/src/Umbraco.Core/Migrations/Upgrade/V_7_10_0/RenamePreviewFolder.cs b/src/Umbraco.Core/Migrations/Upgrade/V_7_10_0/RenamePreviewFolder.cs index 4f404b295a..a73fb8a325 100644 --- a/src/Umbraco.Core/Migrations/Upgrade/V_7_10_0/RenamePreviewFolder.cs +++ b/src/Umbraco.Core/Migrations/Upgrade/V_7_10_0/RenamePreviewFolder.cs @@ -1,7 +1,5 @@ using System.IO; using Umbraco.Core.IO; -using Umbraco.Core.Logging; -using Umbraco.Core.Persistence.SqlSyntax; using File = System.IO.File; namespace Umbraco.Core.Migrations.Upgrade.V_7_10_0 @@ -13,9 +11,9 @@ namespace Umbraco.Core.Migrations.Upgrade.V_7_10_0 /// public class RenamePreviewFolder : MigrationBase { - public RenamePreviewFolder(IMigrationContext context) : base(context) - { - } + public RenamePreviewFolder(IMigrationContext context) + : base(context) + { } public override void Migrate() { @@ -31,9 +29,8 @@ namespace Umbraco.Core.Migrations.Upgrade.V_7_10_0 $"Instead they have been recreated as MVC views and can now be found in '~/Umbraco/Views/Preview'.\r\n" + $"See issue: http://issues.umbraco.org/issue/U4-11090"; File.WriteAllText(Path.Combine(newPath, "readme.txt"), readmeText); - } + } } } - } } diff --git a/src/Umbraco.Core/PropertyEditors/ValueConverters/IntegerValueConverter.cs b/src/Umbraco.Core/PropertyEditors/ValueConverters/IntegerValueConverter.cs index c0fa4bb88c..51c902fe1a 100644 --- a/src/Umbraco.Core/PropertyEditors/ValueConverters/IntegerValueConverter.cs +++ b/src/Umbraco.Core/PropertyEditors/ValueConverters/IntegerValueConverter.cs @@ -18,11 +18,6 @@ namespace Umbraco.Core.PropertyEditors.ValueConverters public override object ConvertSourceToIntermediate(IPublishedElement owner, PublishedPropertyType propertyType, object source, bool preview) { return source.TryConvertTo().Result; - - // in json an integer comes back as Int64 - // ignore overflows ;( - if (source is long) - return Convert.ToInt32(source); } } } diff --git a/src/Umbraco.Core/Services/Implement/UserService.cs b/src/Umbraco.Core/Services/Implement/UserService.cs index 0c200c0184..9c5d65c6f3 100644 --- a/src/Umbraco.Core/Services/Implement/UserService.cs +++ b/src/Umbraco.Core/Services/Implement/UserService.cs @@ -198,18 +198,10 @@ namespace Umbraco.Core.Services.Implement } catch (DbException ex) { - // fixme kill in v8 - //we need to handle this one specific case which is when we are upgrading to 7.7 since the user group - //tables don't exist yet. This is the 'easiest' way to deal with this without having to create special - //version checks in the BackOfficeSignInManager and calling into other special overloads that we'd need - //like "GetUserById(int id, bool includeSecurityData)" which may cause confusion because the result of - //that method would not be cached. - // fixme kill in v8 - //we need to handle this one specific case which is when we are upgrading to 7.7 since the user group - //tables don't exist yet. This is the 'easiest' way to deal with this without having to create special - //version checks in the BackOfficeSignInManager and calling into other special overloads that we'd need - //like "GetUserById(int id, bool includeSecurityData)" which may cause confusion because the result of - //that method would not be cached. + // fixme - refactor users/upgrade + // currently kinda accepting anything on upgrade, but that won't deal with all cases + // so we need to do it differently, see the custom UmbracoPocoDataBuilder which should + // be better BUT requires that the app restarts after the upgrade! if (_isUpgrading) { //NOTE: this will not be cached @@ -735,12 +727,10 @@ namespace Umbraco.Core.Services.Implement } catch (DbException ex) { - // fixme kill in v8 - //we need to handle this one specific case which is when we are upgrading to 7.7 since the user group - //tables don't exist yet. This is the 'easiest' way to deal with this without having to create special - //version checks in the BackOfficeSignInManager and calling into other special overloads that we'd need - //like "GetUserById(int id, bool includeSecurityData)" which may cause confusion because the result of - //that method would not be cached. + // fixme - refactor users/upgrade + // currently kinda accepting anything on upgrade, but that won't deal with all cases + // so we need to do it differently, see the custom UmbracoPocoDataBuilder which should + // be better BUT requires that the app restarts after the upgrade! if (_isUpgrading) { //NOTE: this will not be cached diff --git a/src/Umbraco.Core/Umbraco.Core.csproj b/src/Umbraco.Core/Umbraco.Core.csproj index 515d5009c4..373d49c5aa 100644 --- a/src/Umbraco.Core/Umbraco.Core.csproj +++ b/src/Umbraco.Core/Umbraco.Core.csproj @@ -329,6 +329,7 @@ +