mirror of
https://github.com/moodle/moodle.git
synced 2025-04-14 04:52:36 +02:00
MDL-51110 badges: prevent duplicate award of badges
Previously duplicate users could be returned when they had done duplicate badge criteria - this would lead to a duplicate constraint being hit as they were attempted to be awarded twice.
This commit is contained in:
parent
dda862abb5
commit
5f92c736e3
@ -472,7 +472,7 @@ class badge {
|
||||
$wheresql = ' WHERE u.id ' . $earnedsql;
|
||||
}
|
||||
list($enrolledsql, $enrolledparams) = get_enrolled_sql($this->get_context(), 'moodle/badges:earnbadge', 0, true);
|
||||
$sql = "SELECT u.id
|
||||
$sql = "SELECT DISTINCT u.id
|
||||
FROM {user} u
|
||||
{$extrajoin}
|
||||
JOIN ({$enrolledsql}) je ON je.id = u.id " . $wheresql . $extrawhere;
|
||||
|
Loading…
x
Reference in New Issue
Block a user