From db922230b121639de59e3602f3c9969a3e358a05 Mon Sep 17 00:00:00 2001 From: William Mortada Date: Wed, 11 Oct 2017 20:18:18 +0100 Subject: [PATCH] Get Drupal database connection settings to prefill form --- install/index.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/install/index.php b/install/index.php index 1beae84ffe..fd22adbf1a 100644 --- a/install/index.php +++ b/install/index.php @@ -267,6 +267,9 @@ if ($installType == 'drupal') { } } + // Bootstrap Drupal to get settings + drupal_bootstrap(DRUPAL_BOOTSTRAP_CONFIGURATION); + if (!defined('VERSION') or version_compare(VERSION, '6.0') < 0) { $errorTitle = ts("Oops! Incorrect Drupal version"); $errorMsg = ts("This version of CiviCRM can only be used with Drupal 6.x or 7.x. Please ensure that '%1' exists if you are running Drupal 7.0 and over.", array(1 => implode("' or '", $drupalVersionFiles))); @@ -345,10 +348,10 @@ if ($installType == 'drupal') { } else { $drupalConfig = array( - "server" => "localhost", - "username" => "drupal", - "password" => "", - "database" => "drupal", + "server" => $databases['default']['default']['host'], + "username" => $databases['default']['default']['username'], + "password" => $databases['default']['default']['password'], + "database" => $databases['default']['default']['database'], ); } } -- 2.25.1