diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-10-22 15:41:45 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-10-22 15:41:45 +0000 |
commit | a89aa3b19d18761b8bf7f59d13108618c98e5a59 (patch) | |
tree | 16dbf86f41c35a892fc9e0d87af3a8522f343040 | |
parent | 748d7ea037ca1857977c825cbee25b61ff0c5ea7 (diff) | |
download | drupal-a89aa3b19d18761b8bf7f59d13108618c98e5a59.tar.gz drupal-a89aa3b19d18761b8bf7f59d13108618c98e5a59.zip |
#887288 by catch, David_Rothstein: Fixed Attempting to use update.php without having configured a database in settings.php results in incorrect/misleading error message
-rw-r--r-- | includes/update.inc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/includes/update.inc b/includes/update.inc index 459dc0a541e..d1993e0c3ce 100644 --- a/includes/update.inc +++ b/includes/update.inc @@ -125,7 +125,11 @@ function update_prepare_d7_bootstrap() { $pdo_link = 'http://drupal.org/requirements/pdo#pecl'; } // Check that the correct driver is loaded for the database being updated. - elseif (!in_array($databases['default']['default']['driver'], PDO::getAvailableDrivers())) { + // If we have no driver information (for example, if someone tried to create + // the Drupal 7 $databases array themselves but did not do it correctly), + // this message will be confusing, so do not perform the check; instead, just + // let the database connection fail in the code that follows. + elseif (isset($databases['default']['default']['driver']) && !in_array($databases['default']['default']['driver'], PDO::getAvailableDrivers())) { $message = '<h2>A PDO database driver is required!</h2><p>You need to enable the PDO_' . strtoupper($databases['default']['default']['driver']) . ' database driver for PHP ' . DRUPAL_MINIMUM_PHP . ' or higher so that Drupal 7 can access the database.</p>'; } if ($message) { |