function install_settings_form_validate in Drupal 7
Same name and namespace in other branches
- 5 install.php \install_settings_form_validate()
- 6 install.php \install_settings_form_validate()
Form validation handler for install_settings_form().
See also
install_settings_form_submit()
File
- includes/
install.core.inc, line 952 - API functions for installing Drupal.
Code
function install_settings_form_validate($form, &$form_state) {
$driver = $form_state['values']['driver'];
$database = $form_state['values'][$driver];
$database['driver'] = $driver;
// TODO: remove when PIFR will be updated to use 'db_prefix' instead of
// 'prefix' in the database settings form.
$database['prefix'] = $database['db_prefix'];
unset($database['db_prefix']);
$form_state['storage']['database'] = $database;
$errors = install_database_errors($database, $form_state['values']['settings_file']);
foreach ($errors as $name => $message) {
form_set_error($name, $message);
}
}