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

Capabilities overview breaks if there is a missing context.

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      The easiest way to test this is to hack directly in the database:

      1. Make a new override somewhere through the UI.
      2. In the DB, edit the context of that override, and change the context path so that the parent context is something that does not exist.
      3. Then, go to Admin -> Users -> Permissions -> Capability overview and run the report for the capability you overrode.
      4. Verify that you can see the report for all the context where things are fine. The context where you broke the path just will not show up.
      Show
      The easiest way to test this is to hack directly in the database: Make a new override somewhere through the UI. In the DB, edit the context of that override, and change the context path so that the parent context is something that does not exist. Then, go to Admin -> Users -> Permissions -> Capability overview and run the report for the capability you overrode. Verify that you can see the report for all the context where things are fine. The context where you broke the path just will not show up.
    • Affected Branches:
      MOODLE_25_STABLE
    • Fixed Branches:
      MOODLE_24_STABLE, MOODLE_25_STABLE, MOODLE_26_STABLE
    • Pull from Repository:
    • Pull Master Branch:

      Description

      Suppose that, due to a past bug, you have some a role_capability that points to a non-existent contextid.

      In this case tool_capability dies with a fatal error. It should do handle it better.

        Attachments

          Activity

            People

            Assignee:
            timhunt Tim Hunt
            Reporter:
            timhunt Tim Hunt
            Peer reviewer:
            Petr Skoda
            Integrator:
            Sam Hemelryk
            Tester:
            Frédéric Massart
            Participants:
            Component watchers:
            Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              13/Jan/14