Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.9.2, 2.0
-
Component/s: Libraries, Roles / Access
-
Labels:None
-
Database:Any
-
Affected Branches:MOODLE_19_STABLE, MOODLE_20_STABLE
-
Fixed Branches:MOODLE_19_STABLE, MOODLE_20_STABLE
Description
Review some queries in accesslib, switching from outer joins to unions, checking cross-db.
Well, finally I've ended with the attached patch for 19_STABLE, where a 3-UNION query is performed.
// - courses where user has an explicit enrolment
// - courses that have an override (any status) on that capability
// - categories where user has the rights (granted status) on that capability
The 2 first are executed always, while the 3rd is only added if we have previously detected that capability in any category, so sites not using category assignments will save it.
I think it respect the original behaviour of the heavy OUTER JOIN query, retrieving exactly the same target courses in any situation.
Now it's time to measure if it really produces any improvement, both in sites having and not having role assignments at category level.
Any feedback will be welcome. Thanks for spotting this!
Ciao