Turns out this change was just wrong, we shouldn't be allowing linking
to unaavilable sections. Just show the availability information on the
'index page'
This reverts commit
87a31bb5d8fedd4447cf99cef13c5dd367c3ea3e.
$coursesections = $modinfo->get_section_info($section, MUST_EXIST);
// Check user is allowed to see it.
- if (!$coursesections->uservisible && !empty($section->availableinfo)) {
+ if (!$coursesections->uservisible) {
// Note: We actually already know they don't have this capability
// or uservisible would have been true; this is just to get the
// correct error message shown.