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

Accesslib role caching get confused by a role with no capabilities

XMLWordPrintable

    • MOODLE_34_STABLE, MOODLE_35_STABLE, MOODLE_36_STABLE
    • MOODLE_34_STABLE, MOODLE_35_STABLE
    • Hide

      I think that a full Moodle CI run is the best way to verify that this change at the heart of accesslib.php does not cause any regressions.

      New PHPunit tests have been added to verify that the caching is working as intended.

      I think no manual testing is needed.

      Show
      I think that a full Moodle CI run is the best way to verify that this change at the heart of accesslib.php does not cause any regressions. New PHPunit tests have been added to verify that the caching is working as intended. I think no manual testing is needed.

      Steps to reproduce (easiest to be logged in in one browser as admin, and another as Student):

      1. Turn on performance info, so you can see a count of DB queries in the page footer.
      2. Log in as student, view a course page, and check the performance information is there. (Try to find a course with many activities.)
      3. Note the number of DB reads.
      4. Creat a new role, name 'Incapabable'
      5. Assigne that role to the student use, either at system level, or in the course.
      6. Logged in as student, reload the course page.
      7. Note the number of DB queries.

      Expected result: the number of queries does not change much.

      Actual result: the number of queries jumps by about the number of has_capability calls on the page.

      Verification:

      1. Edit the 'Incapable' role and add any one capability.
      2. As student, reload the course page.
      3. Verify that the number of DB queries goes down again.

            timhunt Tim Hunt
            timhunt Tim Hunt
            Skylar Kelty Skylar Kelty
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            CiBoT CiBoT
            Votes:
            2 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:

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