moodle-format_onetopic
moodle-format_onetopic copied to clipboard
fixed endless redirects
in case the section is unavailable (i.e. has availability restrictions that are not met) but the user can view hidden sections (i.e. has 'moodle/course:viewhiddensections'
Fixes #155
Checking $section->uservisible
is enough because as you can see in lib/modinfolib.php#L3236-L3253 it already checks $section->visible
, $section->available
and both capabilities 'moodle/course:viewhiddensections'
and 'moodle/course:ignoreavailabilityrestrictions'
since Moodle version 3.3.