diff --git a/Oqtane.Client/Themes/Controls/ModuleActionsBase.cs b/Oqtane.Client/Themes/Controls/ModuleActionsBase.cs index 9dd748e66..c5254428f 100644 --- a/Oqtane.Client/Themes/Controls/ModuleActionsBase.cs +++ b/Oqtane.Client/Themes/Controls/ModuleActionsBase.cs @@ -75,8 +75,7 @@ protected virtual List GetActions() private async Task EditUrlAsync(string url, int moduleId, string import) { await Task.Yield(); - EditUrl(moduleId, import); - return url; + return EditUrl(moduleId, import); } protected async Task ModuleAction(ActionViewModel action) diff --git a/Oqtane.Server/Infrastructure/DatabaseManager.cs b/Oqtane.Server/Infrastructure/DatabaseManager.cs index 61b62589c..57551bbb6 100644 --- a/Oqtane.Server/Infrastructure/DatabaseManager.cs +++ b/Oqtane.Server/Infrastructure/DatabaseManager.cs @@ -367,7 +367,7 @@ private Installation MigrateModules(InstallConfig install) } } } - if (moduledefinition.Version != versions[versions.Length - 1]) + if (string.IsNullOrEmpty(result.Message) && moduledefinition.Version != versions[versions.Length - 1]) { moduledefinition.Version = versions[versions.Length - 1]; db.Entry(moduledefinition).State = EntityState.Modified; diff --git a/Oqtane.Server/Repository/ModuleDefinitionRepository.cs b/Oqtane.Server/Repository/ModuleDefinitionRepository.cs index 117c7ae7d..0e968076c 100644 --- a/Oqtane.Server/Repository/ModuleDefinitionRepository.cs +++ b/Oqtane.Server/Repository/ModuleDefinitionRepository.cs @@ -129,7 +129,14 @@ private List LoadSiteModuleDefinitions(int siteId) } else { - moduledefinition.Permissions = permissions.Where(item => item.EntityId == moduledef.ModuleDefinitionId).EncodePermissions(); + if (permissions.Where(item => item.EntityId == moduledef.ModuleDefinitionId).Any()) + { + moduledefinition.Permissions = permissions.Where(item => item.EntityId == moduledef.ModuleDefinitionId).EncodePermissions(); + } + else + { + _permissions.UpdatePermissions(siteId, EntityNames.ModuleDefinition, moduledef.ModuleDefinitionId, moduledefinition.Permissions); + } } } // remove module definition from list as it is already synced