diff --git a/core/includes/install.core.inc b/core/includes/install.core.inc index 36b6b1418dd6078bfaf0d28c8d7ca1f22421603b..2e8f16baed990e2d31f9fb20988a2934f500cd7a 100644 --- a/core/includes/install.core.inc +++ b/core/includes/install.core.inc @@ -1122,11 +1122,9 @@ function install_settings_form($form, &$form_state, &$install_state) { '#title' => t('Database type'), '#required' => TRUE, '#default_value' => !empty($database['driver']) ? $database['driver'] : current($drivers_keys), - '#description' => t('The type of database your @drupal data will be stored in.', array('@drupal' => drupal_install_profile_distribution_name())), ); if (count($drivers) == 1) { $form['driver']['#disabled'] = TRUE; - $form['driver']['#description'] .= ' ' . t('Your PHP configuration only supports a single database type, so it has been automatically selected.'); } // Add driver specific configuration options. diff --git a/core/lib/Drupal/Core/Database/Driver/mysql/Install/Tasks.php b/core/lib/Drupal/Core/Database/Driver/mysql/Install/Tasks.php index 5a1f1aeafc6b77d46ff17af9342631ef6c2efa57..714dd2c89f0eef8b8d2cf22ac60e120ca46543dd 100644 --- a/core/lib/Drupal/Core/Database/Driver/mysql/Install/Tasks.php +++ b/core/lib/Drupal/Core/Database/Driver/mysql/Install/Tasks.php @@ -81,4 +81,14 @@ protected function connect() { } return TRUE; } + + /** + * {@inheritdoc} + */ + public function getFormOptions(array $database) { + $form = parent::getFormOptions($database); + $form['advanced_options']['port']['#default_value'] = '3306'; + + return $form; + } } diff --git a/core/lib/Drupal/Core/Database/Driver/pgsql/Install/Tasks.php b/core/lib/Drupal/Core/Database/Driver/pgsql/Install/Tasks.php index 06cc2b073e6cd135bdf4b48d00ffc5dda3747210..3f9c9a5530b546fe340c77a8a062a3c8149e1b92 100644 --- a/core/lib/Drupal/Core/Database/Driver/pgsql/Install/Tasks.php +++ b/core/lib/Drupal/Core/Database/Driver/pgsql/Install/Tasks.php @@ -247,4 +247,14 @@ function initializeDatabase() { $this->fail(t('Drupal could not be correctly setup with the existing database. Revise any errors.')); } } + + /** + * {@inheritdoc} + */ + public function getFormOptions(array $database) { + $form = parent::getFormOptions($database); + $form['advanced_options']['port']['#default_value'] = '5432'; + + return $form; + } } diff --git a/core/lib/Drupal/Core/Database/Driver/sqlite/Install/Tasks.php b/core/lib/Drupal/Core/Database/Driver/sqlite/Install/Tasks.php index 08aa250329631eefe78a3952ed09b0f2251329de..633edc6ca9ea5dbfe433730d98a993bbd8c33c5c 100644 --- a/core/lib/Drupal/Core/Database/Driver/sqlite/Install/Tasks.php +++ b/core/lib/Drupal/Core/Database/Driver/sqlite/Install/Tasks.php @@ -40,7 +40,7 @@ public function minimumVersion() { /** * {@inheritdoc} */ - public function getFormOptions($database) { + public function getFormOptions(array $database) { $form = parent::getFormOptions($database); // Remove the options that only apply to client/server style databases. diff --git a/core/lib/Drupal/Core/Database/Install/Tasks.php b/core/lib/Drupal/Core/Database/Install/Tasks.php index 929dde86c6b73ed8d4470ddd096cf263ebccb3bd..e80dd8687ffbd3b2bdd54f742f460b04f897bbff 100644 --- a/core/lib/Drupal/Core/Database/Install/Tasks.php +++ b/core/lib/Drupal/Core/Database/Install/Tasks.php @@ -209,14 +209,13 @@ protected function checkEngineVersion() { * @return * The options form array. */ - public function getFormOptions($database) { + public function getFormOptions(array $database) { $form['database'] = array( '#type' => 'textfield', '#title' => t('Database name'), '#default_value' => empty($database['database']) ? '' : $database['database'], '#size' => 45, '#required' => TRUE, - '#description' => t('The name of the database your @drupal data will be stored in.', array('@drupal' => drupal_install_profile_distribution_name())), '#states' => array( 'required' => array( ':input[name=driver]' => array('value' => $this->pdoDriver), @@ -249,7 +248,6 @@ public function getFormOptions($database) { '#type' => 'details', '#title' => t('Advanced options'), '#collapsed' => TRUE, - '#description' => t("These options are only necessary for some sites. If you're not sure what you should enter here, leave the default settings or check with your hosting provider."), '#weight' => 10, ); @@ -257,32 +255,29 @@ public function getFormOptions($database) { $db_prefix = ($profile == 'standard') ? 'drupal_' : $profile . '_'; $form['advanced_options']['db_prefix'] = array( '#type' => 'textfield', - '#title' => t('Table prefix'), + '#title' => t('Table name prefix'), '#default_value' => '', '#size' => 45, - '#description' => t('If more than one application will be sharing this database, enter a table prefix such as %prefix for your @drupal site here.', array('@drupal' => drupal_install_profile_distribution_name(), '%prefix' => $db_prefix)), + '#description' => t('If more than one application will be sharing this database, a unique table name prefix–such as %prefix–will prevent collisions.', array('%prefix' => $db_prefix)), '#weight' => 10, ); $form['advanced_options']['host'] = array( '#type' => 'textfield', - '#title' => t('Database host'), + '#title' => t('Host'), '#default_value' => empty($database['host']) ? 'localhost' : $database['host'], '#size' => 45, // Hostnames can be 255 characters long. '#maxlength' => 255, '#required' => TRUE, - '#description' => t('If your database is located on a different server, change this.'), ); $form['advanced_options']['port'] = array( - '#type' => 'textfield', - '#title' => t('Database port'), + '#type' => 'number', + '#title' => t('Port number'), '#default_value' => empty($database['port']) ? '' : $database['port'], - '#size' => 45, - // The maximum port number is 65536, 5 digits. - '#maxlength' => 5, - '#description' => t('If your database server is listening to a non-standard port, enter its number.'), + '#min' => 0, + '#max' => 65536, ); return $form; @@ -308,11 +303,6 @@ public function validateDatabaseSettings($database) { $errors[$database['driver'] . '][advanced_options][db_prefix'] = t('The database table prefix you have entered, %prefix, is invalid. The table prefix can only contain alphanumeric characters, periods, or underscores.', array('%prefix' => $database['prefix'])); } - // Verify the database port. - if (!empty($database['port']) && !is_numeric($database['port'])) { - $errors[$database['driver'] . '][advanced_options][port'] = t('Database port must be a number.'); - } - return $errors; }