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

Teacher My courses exception when some course category is hidden

XMLWordPrintable

    • MOODLE_400_STABLE
    • MOODLE_400_STABLE
    • MDL-74253-master
    • Hide

      Covered by unit test.

      Manual testing:

      1. Create a new course category and click the eye to hide it.
      2. Log in as a normal user (user "t1" if you use MDK)
        1. If not, you could add a new user and log in as this new user.
      3. Go to "My courses".
      4. Confirm there is no error and "My courses" page is loaded. 
      Show
      Covered by unit test. Manual testing: Create a new course category and click the eye to hide it. Log in as a normal user (user "t1" if you use MDK) If not, you could add a new user and log in as this new user. Go to "My courses". Confirm there is no error and "My courses" page is loaded. 
    • Moppies Kanban

      Since MDL-73549 the My course page breaks when some course category is hidden.

      Steps to reproduce:

      1. Create a new course category and click the eye to hide it.
      2. Log in as a normal user (user "t1" if you use MDK)
      3. Go to "My courses"
        1. Expected: my courses page is displayed
        2. What happens: an exception

      The errors are due to the method get_nearest_editable_subcategory. In one of the lines it get a category using:

      $subcategory = static::get($subcategoryid);

      The main problem with the get method is that by default it checks the user permission and raises an exception unless $alwaysreturnhidden param is true.

            amaia Amaia Anabitarte
            tusefomal Ferran Recio
            Carlos Escobedo Carlos Escobedo
            Sara Arjona (@sarjona) Sara Arjona (@sarjona)
            CiBoT CiBoT
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 hours, 1 minute
                2h 1m

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