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:
Shaun Walker 2022-08-06 16:13:53 -04:00 committed by GitHub
commit d35c204e07
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -485,13 +485,15 @@ namespace Oqtane.Infrastructure
foreach (var moduleDefinition in moduleDefinitions.GetModuleDefinitions())
{
if (!string.IsNullOrEmpty(moduleDefinition.ReleaseVersions) && !string.IsNullOrEmpty(moduleDefinition.ServerManagerType))
{
var moduleType = Type.GetType(moduleDefinition.ServerManagerType);
if (moduleType != null)
if (!string.IsNullOrEmpty(moduleDefinition.ReleaseVersions))
{
var versions = moduleDefinition.ReleaseVersions.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
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())
{
@ -530,6 +532,9 @@ namespace Oqtane.Infrastructure
}
}
}
}
}
if (string.IsNullOrEmpty(result.Message) && moduleDefinition.Version != versions[versions.Length - 1])
{
// get module definition from database to retain user customizable property values
@ -546,7 +551,6 @@ namespace Oqtane.Infrastructure
}
}
}
}
if (string.IsNullOrEmpty(result.Message))
{