From 6ea395e685ff7f11fe48af9bdba0a68b88d599d1 Mon Sep 17 00:00:00 2001 From: catch Date: Wed, 4 Jan 2012 14:47:07 +0900 Subject: [PATCH] Issue #1260716 by David_Rothstein: Follow-up for improve language onboarding user experience. --- core/includes/install.core.inc | 19 +++---------------- core/includes/install.inc | 6 ------ core/modules/system/system.api.php | 2 -- 3 files changed, 3 insertions(+), 24 deletions(-) diff --git a/core/includes/install.core.inc b/core/includes/install.core.inc index 6bdbf4d9a36..81c97d651fa 100644 --- a/core/includes/install.core.inc +++ b/core/includes/install.core.inc @@ -533,8 +533,8 @@ function install_tasks($install_state) { // Determine whether translation import tasks will need to be performed. $needs_translations = count($install_state['translations']) > 1 && !empty($install_state['parameters']['langcode']) && $install_state['parameters']['langcode'] != 'en'; - // The first two installation tasks are (by default) language selection and - // profile selection. + // Start with the core installation tasks that run before handing control + // to the install profile. $tasks = array( 'install_select_language' => array( 'display_name' => st('Choose language'), @@ -1229,19 +1229,6 @@ function install_select_language(&$install_state) { return; } else { - // Allow profile to pre-select the language, skipping the selection. - if (isset($install_state['parameters']['profile'])) { - $info = install_profile_info($install_state['parameters']['profile']); - if (isset($info['langcode'])) { - foreach ($files as $file) { - if ($info['langcode'] == $file->langcode) { - $install_state['parameters']['langcode'] = $file->langcode; - return; - } - } - } - } - // We still don't have a langcode, so display a form for selecting one. // Only do this in the case of interactive installations, since this is // not a real form with submit handlers (the database isn't even set up @@ -1277,7 +1264,7 @@ function install_select_language_form($form, &$form_state, $files) { $select_options[$file->langcode] = $standard_languages[$file->langcode][1]; } else { - // If language not found in standard.inc, display it's langcode + // If the language was not found in standard.inc, display its langcode. $select_options[$file->langcode] = $file->langcode; } // Build a list of languages simulated for browser detection. diff --git a/core/includes/install.inc b/core/includes/install.inc index 8d7f22d784e..8f9d00742f0 100644 --- a/core/includes/install.inc +++ b/core/includes/install.inc @@ -663,7 +663,6 @@ function drupal_rewrite_settings($settings = array()) { */ function drupal_verify_profile($install_state) { $profile = $install_state['parameters']['profile']; - $langcode = $install_state['parameters']['langcode']; include_once DRUPAL_ROOT . '/core/includes/file.inc'; include_once DRUPAL_ROOT . '/core/includes/common.inc'; @@ -1264,13 +1263,8 @@ function install_profile_info($profile, $langcode = 'en') { 'version' => NULL, 'hidden' => FALSE, 'php' => DRUPAL_MINIMUM_PHP, - 'langcode' => NULL, - 'custom_language_selection' => FALSE, ); $info = drupal_parse_info_file("profiles/$profile/$profile.info") + $defaults; - if (isset($info['langcode'])) { - $info['custom_language_selection'] = TRUE; - } $info['dependencies'] = array_unique(array_merge( drupal_required_modules(), $info['dependencies'], diff --git a/core/modules/system/system.api.php b/core/modules/system/system.api.php index 19528b9c9e1..e377a9df1a2 100644 --- a/core/modules/system/system.api.php +++ b/core/modules/system/system.api.php @@ -3350,8 +3350,6 @@ function hook_html_head_alter(&$head_elements) { * steps within the installation process. * @param $install_state * An array of information about the current installation state. - * - * @see install_profile_info() */ function hook_install_tasks_alter(&$tasks, $install_state) { // Replace the entire site configuration form provided by Drupal core