Fix for badge scan SQL issue

This commit is contained in:
PMKuipers 2024-12-29 23:26:57 +01:00
parent e8f96845f0
commit 4c556ba402

View file

@ -816,7 +816,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 = p.value
INNER JOIN {competency_coursecomp} cc on CAST(cc.competencyid as VARCHAR(255)) = p.value
WHERE cc.courseid = :courseid AND crit.criteriatype $ctypesql $conditions";
$competencyrelids = $DB->get_fieldset_sql($sql, $sqlparams);