MDL-85766 block_glossary_random: reset keys of retrieved entries.

This commit is contained in:
Paul Holden
2025-07-30 13:05:04 +01:00
parent 5780da5481
commit 59e21e6b3d
@@ -86,6 +86,9 @@ class block_glossary_random extends block_base {
WHERE glossaryid = ? AND approved = 1
ORDER BY timemodified ASC', [$this->config->glossary]);
// Reset entries keys, so subsequent selection by index works correctly.
$entries = array_values($entries);
if (empty($entries)) {
$text = get_string('noentriesyet', 'block_glossary_random');
} else {