From d49e06255c960ad53a5bfcf4ea5cc4d6bcddccaf Mon Sep 17 00:00:00 2001 From: Stephan Date: Mon, 22 Oct 2018 10:34:04 +0200 Subject: [PATCH] Fix upgrade message --- src/Umbraco.Core/Runtime/CoreRuntime.cs | 6 +++--- src/Umbraco.Web/Install/InstallSteps/UpgradeStep.cs | 13 ++++++------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/Umbraco.Core/Runtime/CoreRuntime.cs b/src/Umbraco.Core/Runtime/CoreRuntime.cs index 0d967cb054..04eaba3f9a 100644 --- a/src/Umbraco.Core/Runtime/CoreRuntime.cs +++ b/src/Umbraco.Core/Runtime/CoreRuntime.cs @@ -307,9 +307,9 @@ namespace Umbraco.Core.Runtime throw new BootFailedException("A connection string is configured but Umbraco could not connect to the database."); } - // if we already know we want to upgrade, no need to look for migrations... - if (_state.Level == RuntimeLevel.Upgrade) - return; + // if we already know we want to upgrade, + // still run EnsureUmbracoUpgradeState to get the states + // (v7 will just get a null state, that's ok) // else // look for a matching migration entry - bypassing services entirely - they are not 'up' yet diff --git a/src/Umbraco.Web/Install/InstallSteps/UpgradeStep.cs b/src/Umbraco.Web/Install/InstallSteps/UpgradeStep.cs index 33ceffe616..7d47139721 100644 --- a/src/Umbraco.Web/Install/InstallSteps/UpgradeStep.cs +++ b/src/Umbraco.Web/Install/InstallSteps/UpgradeStep.cs @@ -19,13 +19,12 @@ namespace Umbraco.Web.Install.InstallSteps { get { - var currentVersion = UmbracoVersion.Local; - - //fixme - in this case there's a db but the version is cleared which is fine and a normal way to force the upgrader - // to execute, but before we would detect the current version via the DB like DatabaseSchemaResult.DetermineInstalledVersion - // what now, do we need to? - if (currentVersion == null) - currentVersion = new Semver.SemVersion(0); + // fixme - if UmbracoVersion.Local is null? + // it means that there is a database but the web.config version is cleared + // that was a "normal" way to force the upgrader to execute, and we would detect the current + // version via the DB like DatabaseSchemaResult.DetermineInstalledVersion - magic, do we really + // need this now? + var currentVersion = (UmbracoVersion.Local ?? new Semver.SemVersion(0)).ToString(); var newVersion = UmbracoVersion.SemanticVersion.ToString();