mirror of
https://github.com/moodle/moodle.git
synced 2025-08-06 09:26:35 +02:00
MDL-50646 admin: Use site default lang as new user's preferred lang
As a result of MDL-49632, the preferred language is no longer part of the "Add a new user" form. So the lang property is not passed to the user_create_user() when creating a new user and the value always falls back to "en" (which is the default defined in the database for this column). This patch makes sure that the site default language is used in such case.
This commit is contained in:
parent
f4bfbd5aa2
commit
7e670032bf
1 changed files with 3 additions and 0 deletions
|
@ -88,6 +88,9 @@ function user_create_user($user, $updatepassword = true, $triggerevent = true) {
|
|||
if (!isset($user->trackforums)) {
|
||||
$user->trackforums = $CFG->defaultpreference_trackforums;
|
||||
}
|
||||
if (!isset($user->lang)) {
|
||||
$user->lang = $CFG->lang;
|
||||
}
|
||||
|
||||
$user->timecreated = time();
|
||||
$user->timemodified = $user->timecreated;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue