diff --git a/core/modules/user/lib/Drupal/user/AccountFormController.php b/core/modules/user/lib/Drupal/user/AccountFormController.php index b5b0f8c..e9ce1ac 100644 --- a/core/modules/user/lib/Drupal/user/AccountFormController.php +++ b/core/modules/user/lib/Drupal/user/AccountFormController.php @@ -242,25 +242,22 @@ public function form(array $form, array &$form_state) { // Only show the account setting for Administration pages language to users // if one of the detection and selection methods uses it. - if ($this->moduleHandler->moduleExists('language')) { - $show_admin_language = FALSE; - if ($this->languageManager->isMultilingual() ) { - foreach (language_types_info() as $type_key => $language_type) { - $negotiation_settings = variable_get("language_negotiation_{$type_key}", array()); - if ($show_admin_language = isset($negotiation_settings[LANGUAGE_NEGOTIATION_USER_ADMIN])) { - break; - } + $show_admin_language = FALSE; + if ($this->moduleHandler->moduleExists('language') && $this->languageManager->isMultilingual()) { + foreach (language_types_info() as $type_key => $language_type) { + $negotiation_settings = variable_get("language_negotiation_{$type_key}", array()); + if ($show_admin_language = isset($negotiation_settings[LANGUAGE_NEGOTIATION_USER_ADMIN])) { + break; } } - $form['language']['preferred_admin_langcode'] = array( - '#type' => 'language_select', - '#title' => t('Administration pages language'), - '#languages' => Language::STATE_CONFIGURABLE, - '#default_value' => $user_preferred_admin_langcode, - '#access' => $show_admin_language && user_access('access administration pages', $account), - ); } - + $form['language']['preferred_admin_langcode'] = array( + '#type' => 'language_select', + '#title' => t('Administration pages language'), + '#languages' => Language::STATE_CONFIGURABLE, + '#default_value' => $user_preferred_admin_langcode, + '#access' => $show_admin_language && user_access('access administration pages', $account), + ); // User entities contain both a langcode property (for identifying the // language of the entity data) and a preferred_langcode property (see // above). Rather than provide a UI forcing the user to choose both