From eb401bd4093c2b63d79eaf911776a65f47f2ecfb Mon Sep 17 00:00:00 2001 From: Matt Glaman Date: Thu, 22 Oct 2020 12:03:13 -0500 Subject: [PATCH] dev/core#2140 Fix site path for Drupal 8 and 9 This fixes hardcoded assumptions of the site path. This breaks testing integration, which has sites in a subdirectory of `simpletest` --- setup/plugins/init/Drupal8.civi-setup.php | 2 +- setup/src/Setup/DrupalUtil.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup/plugins/init/Drupal8.civi-setup.php b/setup/plugins/init/Drupal8.civi-setup.php index 22034e9089..3522907e0f 100644 --- a/setup/plugins/init/Drupal8.civi-setup.php +++ b/setup/plugins/init/Drupal8.civi-setup.php @@ -32,7 +32,7 @@ if (!defined('CIVI_SETUP')) { // Compute settingsPath. $siteDir = \Civi\Setup\DrupalUtil::getDrupalSiteDir($cmsPath); - $model->settingsPath = implode(DIRECTORY_SEPARATOR, [$cmsPath, 'sites', $siteDir, 'civicrm.settings.php']); + $model->settingsPath = implode(DIRECTORY_SEPARATOR, [$cmsPath, $siteDir, 'civicrm.settings.php']); if (($loadGenerated = \Drupal\Core\Site\Settings::get('civicrm_load_generated', NULL)) !== NULL) { $model->loadGenerated = $loadGenerated; diff --git a/setup/src/Setup/DrupalUtil.php b/setup/src/Setup/DrupalUtil.php index 8d1e95bc2e..d16717dc2e 100644 --- a/setup/src/Setup/DrupalUtil.php +++ b/setup/src/Setup/DrupalUtil.php @@ -20,7 +20,7 @@ class DrupalUtil { return basename(conf_path()); } elseif (class_exists('Drupal')) { - return basename(\Drupal::service('site.path')); + return \Drupal::service('site.path'); } else { throw new \Exception('Cannot detect path under Drupal "sites/".'); -- 2.25.1