diff --git a/course/lib.php b/course/lib.php index 71982bcbb49..766c775adf3 100644 --- a/course/lib.php +++ b/course/lib.php @@ -1777,7 +1777,7 @@ function print_section($course, $section, $mods, $modnamesused, $absolute=false, // see the activity itself, or for staff) if (!$mod->uservisible) { echo '
'; - } else if ($canviewhidden && !empty($CFG->enableavailability)) { + } else if ($canviewhidden && !empty($CFG->enableavailability) && $mod->visible) { $ci = new condition_info($mod); $fullinfo = $ci->get_full_information(); if($fullinfo) { diff --git a/lib/conditionlib.php b/lib/conditionlib.php index f3279a19dbc..4fcf91ecbe7 100644 --- a/lib/conditionlib.php +++ b/lib/conditionlib.php @@ -546,6 +546,16 @@ WHERE } } + // If the item is marked as 'not visible' then we don't change the available + // flag (visible/available are treated distinctly), but we remove any + // availability info. If the item is hidden with the eye icon, it doesn't + // make sense to show 'Available from