MDL-55371 mod_assign: Do not return empty users in get_participant WS

The WS was returning null users making the WS to fail.
This commit is contained in:
Juan Leyva 2017-05-04 10:09:35 +02:00
parent 06e3b6d8ba
commit 396395b8d3
2 changed files with 12 additions and 3 deletions

View file

@ -2775,7 +2775,9 @@ class mod_assign_external extends external_api {
// Skip the expensive lookup of user detail if we're blind marking or the caller
// hasn't asked for user details to be embedded.
if (!$assign->is_blind_marking() && $embeduser) {
$return['user'] = user_get_user_details($participant, $course);
if ($userdetails = user_get_user_details($participant, $course)) {
$return['user'] = $userdetails;
}
}
return $return;