Skip to content

Commit 1f359b6

Browse files
committed
TD-3838 Returns null int instead of zero and comments id manipulation code
1 parent af13dee commit 1f359b6

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

DigitalLearningSolutions.Data/DataServices/CourseContentService.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,13 +269,13 @@ FROM Sessions AS S1 WITH (NOLOCK)
269269
{
270270
try
271271
{
272-
return connection.QueryFirst<int>(
272+
return connection.QueryFirst<int?>(
273273
@"SELECT COALESCE((SELECT ProgressID
274274
FROM Progress
275275
WHERE CandidateID = @candidateId
276276
AND CustomisationID = @customisationId
277277
AND SystemRefreshed = 0
278-
AND RemovedDate IS NULL), 0) AS ProgressId",
278+
AND RemovedDate IS NULL), NULL) AS ProgressId",
279279
new { candidateId, customisationId }
280280
);
281281
}

DigitalLearningSolutions.Web/Controllers/LearningMenuController/LearningMenuController.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,11 @@ public IActionResult Index(int customisationId)
8585
var sectionId = courseContent.Sections.First().Id;
8686
return RedirectToAction("Section", "LearningMenu", new { customisationId, sectionId });
8787
}
88-
if (UniqueIdManipulationDetected(candidateId, customisationId))
89-
{
90-
return RedirectToAction("StatusCode", "LearningSolutions", new { code = 404 });
91-
}
88+
// Unique Id Manipulation Detection is being disabled as part of work on TD-3838 - a bug created by its introduction
89+
//if (UniqueIdManipulationDetected(candidateId, customisationId))
90+
//{
91+
// return RedirectToAction("StatusCode", "LearningSolutions", new { code = 404 });
92+
//}
9293
var progressId = courseContentService.GetOrCreateProgressId(candidateId, customisationId, centreId);
9394
if (progressId == null)
9495
{
@@ -97,6 +98,7 @@ public IActionResult Index(int customisationId)
9798
$"Candidate id: {candidateId}, customisation id: {customisationId}, centre id: {centreId}");
9899
return RedirectToAction("StatusCode", "LearningSolutions", new { code = 404 });
99100
}
101+
100102
if (sessionService.StartOrUpdateDelegateSession(candidateId, customisationId, HttpContext.Session) > 0)
101103
{
102104
courseContentService.UpdateProgress(progressId.Value);

0 commit comments

Comments
 (0)