Skip to content

Commit

Permalink
Ignore drushrc.php writing when settings disabled (#2684)
Browse files Browse the repository at this point in the history
  • Loading branch information
joelpittet committed Dec 29, 2020
1 parent 2ff4f0b commit 5491d0c
Showing 1 changed file with 22 additions and 11 deletions.
33 changes: 22 additions & 11 deletions pkg/ddevapp/drupal.go
Expand Up @@ -123,7 +123,7 @@ if (version_compare(Drupal::VERSION, "8.8.0", '<') &&
empty($config_directories[CONFIG_SYNC_DIRECTORY])) {
$config_directories[CONFIG_SYNC_DIRECTORY] = 'sites/default/files/sync';
}
// For D8.8/D8.9, set $settings['config_sync_directory'] if neither
// For D8.8/D8.9, set $settings['config_sync_directory'] if neither
// $config_directories nor $settings['config_sync_directory is set
if (version_compare(DRUPAL::VERSION, "8.8.0", '>=') &&
version_compare(DRUPAL::VERSION, "9.0.0", '<') &&
Expand Down Expand Up @@ -602,25 +602,31 @@ func drupal9ConfigOverrideAction(app *DdevApp) error {
// drupal8PostStartAction handles default post-start actions for D8 apps, like ensuring
// useful permissions settings on sites/default.
func drupal8PostStartAction(app *DdevApp) error {
if !app.DisableSettingsManagement {
if err := createDrupal8SyncDir(app); err != nil {
return err
}
// Return early because we aren't expected to manage settings.
if app.DisableSettingsManagement {
return nil
}
if err := createDrupal8SyncDir(app); err != nil {
return err
}

if err := drupalEnsureWritePerms(app); err != nil {
return err
}
if err := drupalEnsureWritePerms(app); err != nil {
return err
}

if _, err := app.CreateSettingsFile(); err != nil {
return fmt.Errorf("failed to write settings file %s: %v", app.SiteDdevSettingsFile, err)
}
if _, err := app.CreateSettingsFile(); err != nil {
return fmt.Errorf("failed to write settings file %s: %v", app.SiteDdevSettingsFile, err)
}
return nil
}

// drupal7PostStartAction handles default post-start actions for D7 apps, like ensuring
// useful permissions settings on sites/default.
func drupal7PostStartAction(app *DdevApp) error {
// Return early because we aren't expected to manage settings.
if app.DisableSettingsManagement {
return nil
}
if err := drupalEnsureWritePerms(app); err != nil {
return err
}
Expand All @@ -639,6 +645,11 @@ func drupal7PostStartAction(app *DdevApp) error {
// drupal6PostStartAction handles default post-start actions for D6 apps, like ensuring
// useful permissions settings on sites/default.
func drupal6PostStartAction(app *DdevApp) error {
// Return early because we aren't expected to manage settings.
if app.DisableSettingsManagement {
return nil
}

if err := drupalEnsureWritePerms(app); err != nil {
return err
}
Expand Down

0 comments on commit 5491d0c

Please sign in to comment.