From dcc296403eb3e8995b95c40a5e1a945730d7370e Mon Sep 17 00:00:00 2001 From: Rodrigo Mady Date: Mon, 26 Jun 2023 13:00:02 -0300 Subject: [PATCH] MDL-74570 core_badges: Fix for Oracle DB compatibility --- lib/badgeslib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/badgeslib.php b/lib/badgeslib.php index 2c017ed2ef8..64dc83198ab 100644 --- a/lib/badgeslib.php +++ b/lib/badgeslib.php @@ -404,8 +404,8 @@ function badges_get_badge_by_hash(string $hash): object|bool { {user} u WHERE b.id = bi.badgeid AND u.id = bi.userid - AND bi.uniquehash = :uniquehash'; - $badge = $DB->get_record_sql($sql, ['uniquehash' => $hash]); + AND ' . $DB->sql_compare_text('bi.uniquehash', 40) . ' = ' . $DB->sql_compare_text(':hash', 40); + $badge = $DB->get_record_sql($sql, ['hash' => $hash], IGNORE_MISSING); return $badge; }