From 3e68cf59de24ab96b71960e4460b73e4c458d2b4 Mon Sep 17 00:00:00 2001 From: kevwhitt-hee Date: Thu, 17 Apr 2025 12:02:18 +0100 Subject: [PATCH] TD-5220 Adds FC.ID to ORDER BY clauses to ensure better comparison of order for ungrouped competencies --- .../DataServices/FrameworkDataService.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DigitalLearningSolutions.Data/DataServices/FrameworkDataService.cs b/DigitalLearningSolutions.Data/DataServices/FrameworkDataService.cs index b3176c1bec..3bdf62f412 100644 --- a/DigitalLearningSolutions.Data/DataServices/FrameworkDataService.cs +++ b/DigitalLearningSolutions.Data/DataServices/FrameworkDataService.cs @@ -2435,7 +2435,7 @@ Competencies AS c INNER JOIN CompetencyGroups AS cg ON fcg.CompetencyGroupID = cg.ID WHERE (fc.FrameworkID = @frameworkId) GROUP BY fc.ID, c.ID, cg.Name, cg.Description, c.Name, c.Description, c.AlwaysShowDescription, fcg.Ordering, fc.Ordering - ORDER BY COALESCE(fcg.Ordering,99999), fc.Ordering", + ORDER BY COALESCE(fcg.Ordering,99999), fc.Ordering, fc.ID", new { frameworkId } ); } @@ -2448,7 +2448,7 @@ public List GetFrameworkCompetencyOrder(int frameworkId, List framewor FROM FrameworkCompetencies AS fc LEFT JOIN FrameworkCompetencyGroups AS fcg ON fc.FrameworkCompetencyGroupID = fcg.ID WHERE (fc.FrameworkID = @frameworkId) AND (fc.ID IN @frameworkCompetencyIds) - ORDER BY COALESCE(fcg.Ordering,99999), fc.Ordering", + ORDER BY COALESCE(fcg.Ordering,99999), fc.Ordering, fc.ID", new { frameworkId, frameworkCompetencyIds } ).ToList(); }