-
Notifications
You must be signed in to change notification settings - Fork 546
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
resolve module installation issue where ModuleDefinition Version prop…
…erty was not being populated correctly
- Loading branch information
Showing
2 changed files
with
13 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -142,27 +142,29 @@ private List<ModuleDefinition> ProcessModuleDefinitions(int siteId) | |
if (moduledefinition == null) | ||
{ | ||
// new module definition | ||
moduledefinition = new ModuleDefinition { ModuleDefinitionName = ModuleDefinition.ModuleDefinitionName }; | ||
moduledefinition = new ModuleDefinition { ModuleDefinitionName = ModuleDefinition.ModuleDefinitionName, Version = ModuleDefinition.Version }; | ||
_db.ModuleDefinition.Add(moduledefinition); | ||
_db.SaveChanges(); | ||
ModuleDefinition.Version = ""; | ||
ModuleDefinition.Version = ""; // ensure migrations are executed during startup | ||
} | ||
else | ||
{ | ||
// override user customizable property values | ||
ModuleDefinition.Name = (!string.IsNullOrEmpty(moduledefinition.Name)) ? moduledefinition.Name : ModuleDefinition.Name; | ||
ModuleDefinition.Description = (!string.IsNullOrEmpty(moduledefinition.Description)) ? moduledefinition.Description : ModuleDefinition.Description; | ||
ModuleDefinition.Categories = (!string.IsNullOrEmpty(moduledefinition.Categories)) ? moduledefinition.Categories : ModuleDefinition.Categories; | ||
// 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) | ||
{ | ||
ModuleDefinition.ReleaseVersions = ModuleDefinition.Version; | ||
} | ||
ModuleDefinition.Version = moduledefinition.Version; | ||
|
||
// remove module definition from list as it is already synced | ||
moduledefinitions.Remove(moduledefinition); | ||
} | ||
|
||
// 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) | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
sbwalker
Author
Member
|
||
{ | ||
ModuleDefinition.ReleaseVersions = ModuleDefinition.Version; | ||
} | ||
|
||
// load db properties | ||
ModuleDefinition.ModuleDefinitionId = moduledefinition.ModuleDefinitionId; | ||
ModuleDefinition.CreatedBy = moduledefinition.CreatedBy; | ||
ModuleDefinition.CreatedOn = moduledefinition.CreatedOn; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
When
ModuleDefinition.Version
is empty it throws an exception "System.ArgumentException: 'Version string portion was too short or too long. Arg_ParamName_Name'"I am getting this error in modules 'Visitors' and sometimes 'HtmlText' when installing the initial oqtane