Skip to content

Commit

Permalink
Learnpath: fixing lp list to avoid LP inside a course in an invisible…
Browse files Browse the repository at this point in the history
… or unavailable session -refs BT#19211
  • Loading branch information
NicoDucou committed Sep 28, 2021
1 parent 6f3dc26 commit 97c80fe
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion main/lp/my_list.php
Expand Up @@ -21,11 +21,16 @@
if (!empty($courses)) {
$courseIdList = array_column($courses, 'real_id');
$courseWithSession = [];
$courseIteration = 0;
foreach ($courses as $course) {
if (isset($course['session_id'])) {
if (SESSION_VISIBLE === api_get_session_visibility($course['session_id'])) {
$sessionVisibility = api_get_session_visibility($course['session_id']);
if (SESSION_VISIBLE === $sessionVisibility || SESSION_AVAILABLE === $sessionVisibility) {
$courseWithSession[$course['real_id']] = $course['session_id'];
} else {
unset($courseIdList[$courseIteration]);
}
$courseIteration++;
}
}

Expand Down

0 comments on commit 97c80fe

Please sign in to comment.