-
Task
-
Resolution: Fixed
-
Critical
-
2.2
-
MOODLE_22_STABLE
-
MOODLE_22_STABLE
-
w48_
MDL-30467_m22_delusers
After the accesslib changes in MDL-29602, a number of regressions have been found.
In 2.2, get_context_instance(xxxxx, CONTEXT_USER) can now return false in some cases (like if the user is deleted).
However, some old code always assumes that a context is returned eg:
$usercontextid = get_context_instance(CONTEXT_USER, $userid)->id;
|
Someone must check all the calls to get_context_instance(xxxxx, CONTEXT_USER) and make sure they are handling the case of a returned "false" correctly, eg for the above:
$usercontext = get_context_instance(CONTEXT_USER, $userid);
|
|
if (!$usercontext) {
|
continue;
|
}
|