From 35a0577d7d5a842836ce5a613970865eeeb6a0b2 Mon Sep 17 00:00:00 2001 From: PMKuipers Date: Tue, 31 Dec 2024 16:47:05 +0100 Subject: [PATCH] Fixed cast for postgres --- classes/badgeinfo.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/badgeinfo.php b/classes/badgeinfo.php index e9f6d36..49a4b80 100644 --- a/classes/badgeinfo.php +++ b/classes/badgeinfo.php @@ -818,7 +818,7 @@ class badgeinfo { $sql = "SELECT DISTINCT b.id from {badge} b INNER JOIN {badge_criteria} crit ON b.id = crit.badgeid INNER JOIN {badge_criteria_param} p on p.critid = crit.id - INNER JOIN {competency_coursecomp} cc on cc.competencyid = CAST(COALESCE(p.value, 0) as INTEGER) + INNER JOIN {competency_coursecomp} cc on cc.competencyid = CAST(p.value as INTEGER) WHERE cc.courseid = :courseid AND crit.criteriatype $ctypesql $conditions"; $competencyrelids = $DB->get_fieldset_sql($sql, $sqlparams);