Merge pull request #2341 from sbwalker/dev
Fix #2339 - refactor module upgrade logic to remove requirement on ServerManagerType for modules which have no backend
This commit is contained in:
commit
d35c204e07
|
@ -485,13 +485,15 @@ namespace Oqtane.Infrastructure
|
||||||
|
|
||||||
foreach (var moduleDefinition in moduleDefinitions.GetModuleDefinitions())
|
foreach (var moduleDefinition in moduleDefinitions.GetModuleDefinitions())
|
||||||
{
|
{
|
||||||
if (!string.IsNullOrEmpty(moduleDefinition.ReleaseVersions) && !string.IsNullOrEmpty(moduleDefinition.ServerManagerType))
|
if (!string.IsNullOrEmpty(moduleDefinition.ReleaseVersions))
|
||||||
{
|
|
||||||
var moduleType = Type.GetType(moduleDefinition.ServerManagerType);
|
|
||||||
if (moduleType != null)
|
|
||||||
{
|
{
|
||||||
var versions = moduleDefinition.ReleaseVersions.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
|
var versions = moduleDefinition.ReleaseVersions.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
|
||||||
using (var db = GetInstallationContext())
|
using (var db = GetInstallationContext())
|
||||||
|
{
|
||||||
|
if (!string.IsNullOrEmpty(moduleDefinition.ServerManagerType))
|
||||||
|
{
|
||||||
|
var moduleType = Type.GetType(moduleDefinition.ServerManagerType);
|
||||||
|
if (moduleType != null)
|
||||||
{
|
{
|
||||||
foreach (var tenant in db.Tenant.ToList())
|
foreach (var tenant in db.Tenant.ToList())
|
||||||
{
|
{
|
||||||
|
@ -530,6 +532,9 @@ namespace Oqtane.Infrastructure
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(result.Message) && moduleDefinition.Version != versions[versions.Length - 1])
|
if (string.IsNullOrEmpty(result.Message) && moduleDefinition.Version != versions[versions.Length - 1])
|
||||||
{
|
{
|
||||||
// get module definition from database to retain user customizable property values
|
// get module definition from database to retain user customizable property values
|
||||||
|
@ -546,7 +551,6 @@ namespace Oqtane.Infrastructure
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(result.Message))
|
if (string.IsNullOrEmpty(result.Message))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue
Block a user