From 171da9f6c303e8c78b5faeaf1460c5ef5fc89034 Mon Sep 17 00:00:00 2001 From: Oluwatobi Awe Date: Thu, 29 Sep 2022 23:58:14 +0100 Subject: [PATCH 1/2] checked for empty string in competency description update --- DigitalLearningSolutions.Data/Services/FrameworkService.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/DigitalLearningSolutions.Data/Services/FrameworkService.cs b/DigitalLearningSolutions.Data/Services/FrameworkService.cs index b3db22260f..7c0990d305 100644 --- a/DigitalLearningSolutions.Data/Services/FrameworkService.cs +++ b/DigitalLearningSolutions.Data/Services/FrameworkService.cs @@ -1063,7 +1063,10 @@ public void UpdateFrameworkCompetency(int frameworkCompetencyId, string name, st ); return; } - + if (string.IsNullOrWhiteSpace(description)) + { + description = null; + } //DO WE NEED SOMETHING IN HERE TO CHECK WHETHER IT IS USED ELSEWHERE AND WARN THE USER? var numberOfAffectedRows = connection.Execute( @"UPDATE Competencies SET Name = @name, Description = @description, UpdatedByAdminID = @adminId From db35a7a3f963ab39b53599ee930e2b6bacfaa39b Mon Sep 17 00:00:00 2001 From: Oluwatobi Awe Date: Fri, 30 Sep 2022 00:15:54 +0100 Subject: [PATCH 2/2] Trimming Competency Description. --- DigitalLearningSolutions.Data/Services/FrameworkService.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/DigitalLearningSolutions.Data/Services/FrameworkService.cs b/DigitalLearningSolutions.Data/Services/FrameworkService.cs index 7c0990d305..5eb8bc52af 100644 --- a/DigitalLearningSolutions.Data/Services/FrameworkService.cs +++ b/DigitalLearningSolutions.Data/Services/FrameworkService.cs @@ -1063,6 +1063,7 @@ public void UpdateFrameworkCompetency(int frameworkCompetencyId, string name, st ); return; } + description?.Trim(); if (string.IsNullOrWhiteSpace(description)) { description = null;