Commit be2c6e06 authored by Robert Lyon's avatar Robert Lyon
Browse files

Bug 1749269: Fixing for update user via webservices for 16.10



behatnotneeded

Change-Id: Ieced2e34e4079781c300c4e5f50c5c13bfb12cf8
Signed-off-by: default avatarRobert Lyon <robertl@catalyst.net.nz>
parent 543bd4ad
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -561,13 +561,13 @@ class mahara_user_external extends external_api {
                    $profilefields->{$field} = $user[$field];
                }
            }
            // The student id and preferredname get saved as an artefact and to usr table
            if (isset($user['studentid'])) {
                $profilefields->studentid = $user['studentid'];
            // We need to update the following fields for both the usr and artefact tables
            foreach (array('firstname', 'lastname', 'email', 'studentid', 'preferredname') as $field) {
                if (isset($user[$field])) {
                    $profilefields->{$field} = $user[$field];
                }
            if (isset($user['preferredname'])) {
                $profilefields->preferredname = $user['preferredname'];
            }

            update_user($updated_user, $profilefields, $remoteuser);
        }
        db_commit();