Affects Version/s: 3.4.3, 3.5, 3.6
Component/s: Roles / Access
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.
Affected Branches:MOODLE_34_STABLE, MOODLE_35_STABLE, MOODLE_36_STABLE
Fixed Branches:MOODLE_34_STABLE, MOODLE_35_STABLE
Pull from Repository:
Pull Master Branch:
Pull Master Diff URL:
Steps to reproduce (easiest to be logged in in one browser as admin, and another as Student):
- Turn on performance info, so you can see a count of DB queries in the page footer.
- Log in as student, view a course page, and check the performance information is there. (Try to find a course with many activities.)
- Note the number of DB reads.
- Creat a new role, name 'Incapabable'
- Assigne that role to the student use, either at system level, or in the course.
- Logged in as student, reload the course page.
- 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.
- Edit the 'Incapable' role and add any one capability.
- As student, reload the course page.
- Verify that the number of DB queries goes down again.