Commit 880bb905 authored by Dries's avatar Dries

- Patch #202775 by michaelfavia, jabapyth: fixed database testing and error...

- Patch #202775 by michaelfavia, jabapyth: fixed database testing and error handling during installation.
parent 1931f3b9
......@@ -287,7 +287,7 @@ public function test() {
return FALSE;
}
foreach ($this->tests as $test) {
$return = $this->runTestQuery($test['query'], $test['success'], $test['message'], !empty($tests['fatal']));
$return = $this->runTestQuery($test['query'], $test['success'], $test['message'], !empty($test['fatal']));
if ($return === FALSE) {
return FALSE;
}
......@@ -303,11 +303,14 @@ public function test() {
*/
protected function testConnect() {
try {
// This doesn't actually test the connection.
db_set_active();
// Now actually do a check.
Database::getConnection();
$this->success[] = 'CONNECT';
}
catch (Exception $e) {
drupal_set_message(st('Failed to connect to your %name database server. %name reports the following message: %error.<ul><li>Are you sure you have the correct username and password?</li><li>Are you sure that you have typed the correct database hostname?</li><li>Are you sure that the database server is running?</li></ul>For more help, see the <a href="http://drupal.org/node/258">Installation and upgrading handbook</a>. If you are unsure what these terms mean you should probably contact your hosting provider.', array('%error' => $e->getMessage(), 'name' => $this->name())), 'error');
drupal_set_message(st('Failed to connect to your %name database server. %name reports the following message: <strong>%error</strong>.<ul><li>Are you sure that you have typed the correct database hostname?</li><li>Are you sure that the database server is running?</li><li>Are you sure you have the correct database name?</li><li>Are you sure you have the correct username and password?</li></ul>For more help, see the <a href="http://drupal.org/node/258">Installation and upgrading handbook</a>. If you are unsure what these terms mean you should probably contact your hosting provider.', array('%error' => $e->getMessage(), '%name' => $this->name())), 'error');
return FALSE;
}
}
......
......@@ -267,7 +267,7 @@ function install_settings_form(&$form_state, $profile, $install_locale, $setting
'#size' => 45,
);
// Database username
// Database password
$form['basic_options']['password'] = array(
'#type' => 'password',
'#title' => st('Database password'),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment