Skip to content

Commit

Permalink
MDL-83152 mod_glossary: observe pending entries sort order.
Browse files Browse the repository at this point in the history
Ascending/descending should be compared in a case-insensitive manner
because apparently we use both lower/upper cases for each.
  • Loading branch information
paulholden committed Jan 30, 2025
1 parent 77ecfb7 commit 678cfb7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mod/glossary/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -4074,7 +4074,7 @@ function glossary_get_entries_to_approve($glossary, $context, $letter, $order, $

// Now sort the array in regard to the current language.
if ($order == 'CREATION') {
if ($sort == "DESC") {
if (strcasecmp($sort, 'DESC') === 0) {
usort($filteredentries, function($a, $b) {
return $b->timecreated <=> $a->timecreated;
});
Expand All @@ -4084,7 +4084,7 @@ function glossary_get_entries_to_approve($glossary, $context, $letter, $order, $
});
}
} else if ($order == 'UPDATE') {
if ($sort == "DESC") {
if (strcasecmp($sort, 'DESC') === 0) {
usort($filteredentries, function($a, $b) {
return $b->timemodified <=> $a->timemodified;
});
Expand All @@ -4095,7 +4095,7 @@ function glossary_get_entries_to_approve($glossary, $context, $letter, $order, $
}
} else {
// This means CONCEPT.
if ($sort == "DESC") {
if (strcasecmp($sort, 'DESC') === 0) {
usort($filteredentries, function($a, $b) {
return format_string($b->concept) <=> format_string($a->concept);
});
Expand Down

0 comments on commit 678cfb7

Please sign in to comment.