Gets the v7 upgrade report working on the new installer.
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
The following report list the permissions that are currently failing. Once the permissions are fixed press the 'Go back' button to restart the installation.
|
||||
</p>
|
||||
|
||||
<ul class="permissions-report unstyled">
|
||||
<ul class="permissions-report">
|
||||
<li ng-repeat="(category, items) in installer.current.model.errors">
|
||||
<h4>{{category}}</h4>
|
||||
<ul>
|
||||
|
||||
@@ -1,3 +1,22 @@
|
||||
<div>
|
||||
Upgrade report :)
|
||||
<h1>Major version upgrade from {{installer.current.model.currentVersion}} to {{installer.current.model.newVersion}}</h1>
|
||||
<h2>There were {{installer.current.model.errors.length}} issues detected</h2>
|
||||
<p>
|
||||
The following compatibility issues were found. If you continue all non-compatible property editors will be converted to a Readonly/Label.
|
||||
You will be able to change the property editor to a compatible type manually by editing the data type after installation.
|
||||
</p>
|
||||
<p>
|
||||
Otherwise if you choose not to proceed you will need to fix the errors listed below.
|
||||
Refer to v{{installer.current.model.newVersion}} upgrade instructions for full details.
|
||||
</p>
|
||||
|
||||
<ul class="upgrade-report">
|
||||
<li ng-repeat="item in installer.current.model.errors">
|
||||
{{item}}
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
<button class="btn btn-success" ng-click="forward()">Continue</button>
|
||||
</p>
|
||||
</div>
|
||||
@@ -231,11 +231,15 @@ height: 5px;
|
||||
display:block;
|
||||
padding:0;
|
||||
}
|
||||
|
||||
.permissions-report > li {
|
||||
list-style:none;
|
||||
}
|
||||
|
||||
.permissions-report h4 {
|
||||
margin:7px;
|
||||
}
|
||||
|
||||
.upgrade-report {
|
||||
overflow:auto;
|
||||
height:280px;
|
||||
display:block;
|
||||
}
|
||||
@@ -9,8 +9,7 @@ using Umbraco.Web.Install.Models;
|
||||
namespace Umbraco.Web.Install.InstallSteps
|
||||
{
|
||||
[InstallSetupStep(InstallationType.NewInstall | InstallationType.Upgrade,
|
||||
"Permissions", 0, "Ensuring your file permissions are set correctly",
|
||||
PerformsAppRestart = true)]
|
||||
"Permissions", 0, "Ensuring your file permissions are set correctly")]
|
||||
internal class FilePermissionsStep : InstallSetupStep<object>
|
||||
{
|
||||
public override InstallSetupResult Execute(object model)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Configuration;
|
||||
using Umbraco.Core.Persistence;
|
||||
@@ -28,7 +29,16 @@ namespace Umbraco.Web.Install.InstallSteps
|
||||
return null;
|
||||
}
|
||||
|
||||
return new InstallSetupResult("version7upgradereport", CreateReport());
|
||||
var result = _applicationContext.DatabaseContext.ValidateDatabaseSchema();
|
||||
var determinedVersion = result.DetermineInstalledVersion();
|
||||
|
||||
return new InstallSetupResult("version7upgradereport",
|
||||
new
|
||||
{
|
||||
currentVersion = determinedVersion.ToString(),
|
||||
newVersion = UmbracoVersion.Current.ToString(),
|
||||
errors = CreateReport()
|
||||
});
|
||||
}
|
||||
|
||||
public override bool RequiresExecution(object model)
|
||||
@@ -58,15 +68,18 @@ namespace Umbraco.Web.Install.InstallSteps
|
||||
if ((string.IsNullOrWhiteSpace(GlobalSettings.ConfigurationStatus) == false || determinedVersion.Equals(new Version(0, 0, 0)) == false)
|
||||
&& UmbracoVersion.Current.Major > determinedVersion.Major)
|
||||
{
|
||||
//it's an upgrade to a major version so we're gonna show this step
|
||||
return true;
|
||||
//it's an upgrade to a major version so we're gonna show this step if there are issues
|
||||
|
||||
var report = CreateReport();
|
||||
return report.Any();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private IEnumerable<Tuple<bool, string>> CreateReport()
|
||||
private IEnumerable<string> CreateReport()
|
||||
{
|
||||
var errorReport = new List<Tuple<bool, string>>();
|
||||
var errorReport = new List<string>();
|
||||
|
||||
var sql = new Sql();
|
||||
sql
|
||||
@@ -91,12 +104,12 @@ namespace Umbraco.Web.Install.InstallSteps
|
||||
var editor = PropertyEditorResolver.Current.GetByAlias(alias);
|
||||
if (editor == null)
|
||||
{
|
||||
errorReport.Add(new Tuple<bool, string>(false, string.Format("Property Editor with ID '{0}' (assigned to Data Type '{1}') has a valid GUID -> Alias map but no property editor was found. It will be replaced with a Readonly/Label property editor.", item.controlId, item.text)));
|
||||
errorReport.Add(string.Format("Property Editor with ID '{0}' (assigned to Data Type '{1}') has a valid GUID -> Alias map but no property editor was found. It will be replaced with a Readonly/Label property editor.", item.controlId, item.text));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
errorReport.Add(new Tuple<bool, string>(false, string.Format("Property Editor with ID '{0}' (assigned to Data Type '{1}') does not have a valid GUID -> Alias map. It will be replaced with a Readonly/Label property editor.", item.controlId, item.text)));
|
||||
errorReport.Add(string.Format("Property Editor with ID '{0}' (assigned to Data Type '{1}') does not have a valid GUID -> Alias map. It will be replaced with a Readonly/Label property editor.", item.controlId, item.text));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user