diff options
-rw-r--r-- | includes/install.inc | 7 | ||||
-rw-r--r-- | install.php | 5 |
2 files changed, 10 insertions, 2 deletions
diff --git a/includes/install.inc b/includes/install.inc index 658ef26a2..4c79d832c 100644 --- a/includes/install.inc +++ b/includes/install.inc @@ -227,6 +227,13 @@ function drupal_detect_database_types() { } } + // Usability: unconditionnally put the MySQL driver on top. + if (isset($databases['mysql'])) { + $mysql_database = $databases['mysql']; + unset($databases['mysql']); + $databases = array('mysql' => $mysql_database) + $databases; + } + return $databases; } diff --git a/install.php b/install.php index 30355e4ad..c606aecbe 100644 --- a/install.php +++ b/install.php @@ -194,7 +194,8 @@ function install_change_settings($profile = 'default', $install_locale = '') { $conf_path = './' . conf_path(FALSE, TRUE); $settings_file = $conf_path . '/settings.php'; - $database = $databases['default']['default']; + $database = isset($databases['default']['default']) ? $databases['default']['default'] : array(); + // We always need this because we want to run form_get_errors. include_once './includes/form.inc'; install_task_list('database'); @@ -237,7 +238,7 @@ function install_settings_form(&$form_state, $profile, $install_locale, $setting '#title' => st('Database driver'), '#required' => TRUE, '#options' => $drivers, - '#default_value' => !empty($database['driver']) ? $database['driver'] : current($drivers), + '#default_value' => !empty($database['driver']) ? $database['driver'] : current(array_keys($drivers)), '#description' => st('The type of database your @drupal data will be stored in.', array('@drupal' => drupal_install_profile_name())), ); $database_description = st('The name of the database your @drupal data will be stored in. It must exist on your server before @drupal can be installed.', array('@drupal' => drupal_install_profile_name())); |