Skip to content

Commit

Permalink
added defensive logic to resolve regression issue caused by oqtane#3175
Browse files Browse the repository at this point in the history
  • Loading branch information
sbwalker committed Aug 24, 2023
1 parent 261ed05 commit 0a22f80
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Oqtane.Server/Repository/ModuleDefinitionRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ private List<ModuleDefinition> ProcessModuleDefinitions(int siteId)
moduledefinition = new ModuleDefinition { ModuleDefinitionName = ModuleDefinition.ModuleDefinitionName, Version = ModuleDefinition.Version };
_db.ModuleDefinition.Add(moduledefinition);
_db.SaveChanges();
ModuleDefinition.Version = ""; // ensure migrations are executed during startup
ModuleDefinition.Version = ""; // ensure migrations are executed during startup for new module installations
}
else
{
Expand All @@ -159,7 +159,7 @@ private List<ModuleDefinition> ProcessModuleDefinitions(int siteId)
}

// manage releaseversions in cases where it was not provided or is lower than the module version
if (string.IsNullOrEmpty(ModuleDefinition.ReleaseVersions) || Version.Parse(ModuleDefinition.Version).CompareTo(Version.Parse(ModuleDefinition.ReleaseVersions.Split(',').Last())) > 0)
if (string.IsNullOrEmpty(ModuleDefinition.ReleaseVersions) || (!string.IsNullOrEmpty(ModuleDefinition.Version) && Version.Parse(ModuleDefinition.Version).CompareTo(Version.Parse(ModuleDefinition.ReleaseVersions.Split(',').Last())) > 0))
{
ModuleDefinition.ReleaseVersions = ModuleDefinition.Version;
}
Expand Down

0 comments on commit 0a22f80

Please sign in to comment.