From eeae783ca38b4c837bc7547773ab8d22e6dac163 Mon Sep 17 00:00:00 2001 From: Juan Leyva Date: Fri, 24 Feb 2017 12:42:42 +0100 Subject: [PATCH] MDL-58071 user: Return usernotfullysetup exception in WS If there is an empty required custom user profile field, Web Services should return the usernotfullysetup exception instead ignoring it. The mobile app already handles this exception for core fields redirecting the user to web in order to fill the missing field. --- lib/moodlelib.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/moodlelib.php b/lib/moodlelib.php index 966112fa563..4d83a6f03fb 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -2663,10 +2663,10 @@ function require_login($courseorid = null, $autologinguest = true, $cm = null, $ } // Check that the user account is properly set up. If we can't redirect to - // edit their profile, perform just the lax check. It will allow them to - // use filepicker on the profile edit page. + // edit their profile and this is not a WS request, perform just the lax check. + // It will allow them to use filepicker on the profile edit page. - if ($preventredirect) { + if ($preventredirect && !WS_SERVER) { $usernotfullysetup = user_not_fully_set_up($USER, false); } else { $usernotfullysetup = user_not_fully_set_up($USER, true);