Commit da86c03c authored by catch's avatar catch

Issue #2884141 by drastik: User AccountForm.php sets $admin var but doesn't use

parent 7d510cc1
......@@ -85,7 +85,7 @@ public function form(array $form, FormStateInterface $form_state) {
'#type' => 'email',
'#title' => $this->t('Email address'),
'#description' => $this->t('A valid email address. All emails from the system will be sent to this address. The email address is not made public and will only be used if you wish to receive a new password or wish to receive certain news or notifications by email.'),
'#required' => !(!$account->getEmail() && $user->hasPermission('administer users')),
'#required' => !(!$account->getEmail() && $admin),
'#default_value' => (!$register ? $account->getEmail() : ''),
];
......@@ -222,7 +222,7 @@ public function form(array $form, FormStateInterface $form_state) {
'#open' => TRUE,
// Display language selector when either creating a user on the admin
// interface or editing a user account.
'#access' => !$register || $user->hasPermission('administer users'),
'#access' => !$register || $admin,
];
$form['language']['preferred_langcode'] = [
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment