From 880bb9057fee3765f29634650b728f48b88a5c94 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Mon, 8 Jun 2009 04:33:35 +0000 Subject: - Patch #202775 by michaelfavia, jabapyth: fixed database testing and error handling during installation. --- includes/install.inc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'includes') diff --git a/includes/install.inc b/includes/install.inc index 03ee3e4bd..b618594c8 100644 --- a/includes/install.inc +++ b/includes/install.inc @@ -287,7 +287,7 @@ abstract class DatabaseInstaller { 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 @@ abstract class DatabaseInstaller { */ 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.For more help, see the Installation and upgrading handbook. 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: %error.For more help, see the Installation and upgrading handbook. 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; } } -- cgit v1.2.3