diff --git a/badges/recipients.php b/badges/recipients.php index 4eac9545623..9d3ef91312a 100644 --- a/badges/recipients.php +++ b/badges/recipients.php @@ -87,7 +87,7 @@ if ($badge->has_manual_award_criteria() && has_capability('moodle/badges:awardba $sql = "SELECT b.userid, b.dateissued, b.uniquehash, u.firstname, u.lastname FROM {badge_issued} b INNER JOIN {user} u ON b.userid = u.id - WHERE b.badgeid = :badgeid + WHERE b.badgeid = :badgeid AND u.deleted = 0 ORDER BY $sortby $sorthow"; $totalcount = $DB->count_records('badge_issued', array('badgeid' => $badge->id));