Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-66780

Hiding a section makes it show, in specific circumstances

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • 3.4.9, 3.5.13, 3.7.7, 3.8.4, 3.9.1, 3.9.18, 3.10, 3.11.11, 4.0.5, 4.0.11, 4.1, 4.1.6, 4.2.3, 4.3, 4.4.5, 5.0
    • Course
    • MOODLE_310_STABLE, MOODLE_311_STABLE, MOODLE_34_STABLE, MOODLE_35_STABLE, MOODLE_37_STABLE, MOODLE_38_STABLE, MOODLE_39_STABLE, MOODLE_400_STABLE, MOODLE_401_STABLE, MOODLE_402_STABLE, MOODLE_403_STABLE, MOODLE_404_STABLE, MOODLE_500_STABLE
    • mdl-66780_405
    • mdl-66780_500
    • mdl-66780_main
    • Hide
      1. Create a new Custom sections format course with at least one section.
      2. Set Course settings > Course format > Hidden sections to "Hiden sections are shown as not available", and save.
      3. Turn editing on.
      4. Set Section 1 settings > Restrict access > Access restrictions to something unavailable, such as "Must match Date until 1 January 2000", set the availability eye icon to "Hidden entirely if student doesn't meet this condition", and save.
      5. Return to the course main page.
      6. Set Section 1 to be shown (if it isn't already).
      7. Switch role to student.
      8. Verify Section 1 is hidden entirely.
      9. Return to normal role.
      10. Turn editing on.
      11. Set Section 1 to be hidden.
      12. Switch role to student.
      13. Verify Section 1 is hidden entirely. [This fails before the patch.]
      14. Return to normal role.
      15. Turn editing on.
      16. Set Section 1 settings > Restrict access > Access restrictions > availability eye icon to "Displayed if student doesn't meet this condition", and save.
      17. Return to the course main page.
      18. Switch role to student.
      19. Verify the Section 1 heading is visible.
      20. Verify the Section 1 section availability information reads "Not available", with no further information.
      Show
      Create a new Custom sections format course with at least one section. Set Course settings > Course format > Hidden sections to "Hiden sections are shown as not available", and save. Turn editing on. Set Section 1 settings > Restrict access > Access restrictions to something unavailable, such as "Must match Date until 1 January 2000", set the availability eye icon to "Hidden entirely if student doesn't meet this condition", and save. Return to the course main page. Set Section 1 to be shown (if it isn't already). Switch role to student. Verify Section 1 is hidden entirely. Return to normal role. Turn editing on. Set Section 1 to be hidden. Switch role to student. Verify Section 1 is hidden entirely. [This fails before the patch.] Return to normal role. Turn editing on. Set Section 1 settings > Restrict access > Access restrictions > availability eye icon to "Displayed if student doesn't meet this condition", and save. Return to the course main page. Switch role to student. Verify the Section 1 heading is visible. Verify the Section 1 section availability information reads "Not available", with no further information.
    • Hide

      Code verified against automated checks.

      Checked MDL-66780 using repository: https://github.com/james-cnz/moodle

      More information about this report

      Built on: Sat Apr 19 01:18:24 UTC 2025

      Show
      Code verified against automated checks. Checked MDL-66780 using repository: https://github.com/james-cnz/moodle MOODLE_405_STABLE (0 errors / 0 warnings) [branch: mdl-66780_405 | CI Job ] MOODLE_500_STABLE (0 errors / 0 warnings) [branch: mdl-66780_500 | CI Job ] main (0 errors / 0 warnings) [branch: mdl-66780_main | CI Job ] More information about this report Built on: Sat Apr 19 01:18:24 UTC 2025

      When a section has access restrictions that should hide it entirely, and the section is set to be hidden and the course has the setting Hidden sections are shown as not available, the section is not hidden entirely, but shown as not available.  This is inconsistent behaviour.  In general, the access restrictions and hidden section settings are treated as two filters, both of which a section must pass in order to be visible.  In general, if access restrictions hide a section, then it is hidden, and of the hidden section setting hides a section, then it is hidden, and it is only visible if neither setting hides it.  In this one case, the access restrictions are ignored, and only the hidden section setting applies.

            james-cnz James E. Calder
            james-cnz James E. Calder
            Sumaiya Javed Sumaiya Javed
            Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 minute
                1m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.