Skip to content
Snippets Groups Projects
Commit ac137b4c authored by Jan-Hendrik Willms's avatar Jan-Hendrik Willms Committed by Jan-Hendrik Willms
Browse files

ensure correct order, fixes #751

parent 33f12b79
No related branches found
No related tags found
No related merge requests found
......@@ -194,7 +194,6 @@ class MyCoursesController extends AuthenticatedController
'responsive_type' => Config::get()->MY_COURSES_ALLOW_TILED_DISPLAY && $GLOBALS['user']->cfg->MY_COURSES_TILED_DISPLAY_RESPONSIVE ? 'tiles' : 'tables',
'navigation_show_only_new' => $GLOBALS['user']->cfg->MY_COURSES_SHOW_NEW_ICONS_ONLY,
'group_by' => $this->getGroupField(),
],
];
......@@ -1055,6 +1054,7 @@ class MyCoursesController extends AuthenticatedController
uksort($course['navigation'], function ($a, $b) use ($positions) {
return array_search($a, $positions) - array_search($b, $positions);
});
$course['navigation'] = array_values($course['navigation']);
return $course;
},
$courses
......
......@@ -880,16 +880,16 @@ class MyRealmModel
*/
public static function array_rtrim($array)
{
$temp = array_reverse($array);
$temp = array_reverse($array, true);
$empty = true;
while ($empty && !empty($temp)) {
$item = reset($temp);
if ($empty = ($item === null)) {
$temp = array_slice($temp, 1);
$temp = array_slice($temp, 1, null, true);
}
}
return array_reverse($temp);
return array_reverse($temp, true);
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment