From 2056d3d62933910337a5d3c040e60cb601ff66f0 Mon Sep 17 00:00:00 2001 From: Sara Arjona Date: Tue, 18 Jun 2024 16:04:55 +0200 Subject: [PATCH] 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). --- badges/overview.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/badges/overview.php b/badges/overview.php index dbf814fc778..87ea1d76948 100644 --- a/badges/overview.php +++ b/badges/overview.php @@ -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);