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

Hiding a section makes it show, in specific circumstances

Details

    • Bug
    • Resolution: Unresolved
    • 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
    • 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
    • mdl-66780_401
    • mdl-66780_402
    • mdl-66780_403
    • mdl-66780_master
    • Hide
      1. Create a new Topics 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 Topic 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. Set Topic 1 to be shown.
      6. Switch role to student.
      7. Verify Topic 1 is hidden entirely.
      8. Return to normal role.
      9. Turn editing on.
      10. Set Topic 1 to be hidden.
      11. Switch role to student.
      12. Verify Topic 1 is hidden entirely. [This fails before the patch.]
      13. Return to normal role.
      14. Turn editing on.
      15. Set Topic 1 settings > Restrict access > Access restrictions > availability eye icon to "Displayed if student doesn't meet this condition", and save.
      16. Switch role to student.
      17. Verify the Topic 1 heading is visible.
      18. Verify the Topic 1 section availability information reads "Not available", with no further information.
      Show
      Create a new Topics 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 Topic 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. Set Topic 1 to be shown. Switch role to student. Verify  Topic 1 is hidden entirely. Return to normal role. Turn editing on. Set Topic 1 to be hidden. Switch role to student. Verify  Topic 1 is hidden entirely.  [This fails before the patch.] Return to normal role. Turn editing on. Set Topic 1 settings > Restrict access > Access restrictions > availability eye icon to "Displayed if student doesn't meet this condition", and save. Switch role to student. Verify  the Topic 1 heading is visible. Verify  the Topic 1 section availability information reads "Not available", with no further information.

    Description

      FULL STEPS

      With a given course and section:

      Set the course setting "Format" to "Topics format" or "Weekly format".
      Set the course setting "Hidden sections" to "Hidden sections are shown in collapsed form".

      Turn editing on.
      Set the section setting "Access restrictions" to something unavailable, e.g. "Must match Date until 1 January 2000".
      Set the section setting "Access restrictions" visibility to "Hidden entirely if user does not meet this condition".

      Ensure the section is set to show.
      Switch role to Student.
      The section does not appear.

      Return to normal role.
      Turn editing on.
      Set the section to hidden.
      Switch role to Student again.
      The section now does appear.

      WHAT I EXPECTED

      Hiding a section should not make it show under any circumstances.

      WHAT ACTUALLY HAPPENS

      Hiding a section does make it show in specific circumstances.

      TO FIX

      In course/format/renderer.php function print_multiple_section_page
      change:

      $showsection = $thissection->uservisible ||
      ($thissection->visible && !$thissection->available && !empty($thissection->availableinfo)) ||
      (!$thissection->visible && !$course->hiddensections);

      to:

      $showsection = $thissection->uservisible ||
      ($thissection->visible || !$course->hiddensections)
      && ($thissection->available || !empty($thissection->availableinfo));

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:

                Time Tracking

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

                  Clockify

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