Skip to content
Snippets Groups Projects
Commit ae2d403c authored by Alexander Bias's avatar Alexander Bias
Browse files

Fix silly code with sorting the top level category filter

parent e008b226
No related branches found
No related tags found
No related merge requests found
...@@ -914,12 +914,9 @@ class block_course_overview_campus extends block_base { ...@@ -914,12 +914,9 @@ class block_course_overview_campus extends block_base {
} }
// Sort full category information array by sortorder. // Sort full category information array by sortorder.
$success = usort($filtertoplevelcategoriesfullinfo, "block_course_overview_campus_compare_categories"); $success = usort($filtertoplevelcategoriesfullinfo, "block_course_overview_campus_compare_categories");
// If sorting was not successful, return old array. // If sorting was successful, create new array with same data structure like the old one.
if (!$success) { // Otherwise just leave the old array as it is (should not happen).
return $filtertoplevelcategories; if ($success) {
}
// If sorting was successful, return new array with same data structure like the old one.
else {
$filtertoplevelcategories = array(); $filtertoplevelcategories = array();
foreach ($filtertoplevelcategoriesfullinfo as $ftl) { foreach ($filtertoplevelcategoriesfullinfo as $ftl) {
$filtertoplevelcategories[$ftl->id] = format_string($ftl->name); $filtertoplevelcategories[$ftl->id] = format_string($ftl->name);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment