-
Bug
-
Resolution: Fixed
-
Minor
-
2.6
-
MOODLE_26_STABLE
-
MOODLE_27_STABLE
-
master_
MDL-43049 -
There appears to be a typo in get_user_accessdata() in lib/accesslib.php, L1116-1122:
if (!empty($USER->acces['rdef']) and empty($ACCESSLIB_PRIVATE->rolepermissions)) {
|
// share rdef from USER session with rolepermissions cache in order to conserve memory
|
foreach($USER->acces['rdef'] as $k=>$v) {
|
$ACCESSLIB_PRIVATE->rolepermissions[$k] =& $USER->acces['rdef'][$k];
|
}
|
$ACCESSLIB_PRIVATE->accessdatabyuser[$USER->id] = $USER->acces;
|
}
|
I believe it should be $USER->access, not $USER->acces (all four references in this block).
Because of the first condition the effect of this typo is that this block of code above is never run. While not necessary for the function to work it is there to save memory so assuming that the code is otherwise correct fixing the typo should reduce memory consumption.
- will be (partly) resolved by
-
MDL-43182 Typo in accesslib causes performance optimization to be skipped (backport of MDL-43049)
-
- Closed
-