Skip to content

Commit

Permalink
Merge pull request #18843 from bluehorndigital/dev/core-2140
Browse files Browse the repository at this point in the history
dev/core#2140 Fix site path for Drupal 8 and 9
  • Loading branch information
seamuslee001 authored Oct 22, 2020
2 parents b5f4c7d + eb401bd commit 3c5b905
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion setup/plugins/init/Drupal8.civi-setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

// 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;
Expand Down
2 changes: 1 addition & 1 deletion setup/src/Setup/DrupalUtil.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public static function getDrupalSiteDir($cmsPath) {
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/".');
Expand Down

0 comments on commit 3c5b905

Please sign in to comment.