MDL-82233 badges: Display awarded users only when it applies

The message with the number of uses who have awarded a badge
were displayed always (even when the badge was disabled).
This commit is contained in:
Sara Arjona 2024-06-18 16:04:55 +02:00
parent ad7fc69c25
commit 062acb0529
No known key found for this signature in database

View File

@ -75,7 +75,7 @@ echo $OUTPUT->heading(print_badge_image($badge, $context, 'small') . ' ' . $badg
if ($awards == 'cron') {
echo $OUTPUT->notification(get_string('awardoncron', 'badges'), 'notifysuccess');
} else if ($awards != 0) {
} else if ((int)$awards > 0) {
echo $OUTPUT->notification(get_string('numawardstat', 'badges', $awards), 'notifysuccess');
}
echo $output->print_badge_status_box($badge);