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

Missing categories (and PHP notices raised) in course prerequisite select (Course completion form)

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Duplicate
    • Affects Version/s: 3.3.7
    • Fix Version/s: None
    • Component/s: Course completion
    • Labels:
    • Affected Branches:
      MOODLE_33_STABLE

      Description

      There is an issue when a user has the capability moodle/course:update, and hence can view/edit the completions settings for a course, but does not have the capability moodle/category:viewhiddencategories.

      The list of courses generated for the 'criteria_course' field (course prerequisites) may not have all category info prepended to each course correctly and PHP notices may be raised.

      In this case the course list isn't restricted in the same way as the category list is (rightly so, i believe) and it looks like there possibly needs to be a way to force the make_categories_list() function to ignore the moodle/category:viewhiddencategories check (but it's a little more complex than just that due to the caching).

      An example would be a user who is an 'editingteacher'.

      Discovered in 3.3.7 and looks to be an issue right through to master.

      I'm happy to pick this up myself and propose a potential solution for review.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              xantico-simon Simon Lewis
              Participants:
              Component watchers:
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: