Metadrop / drupal-boilerplate

Drupal projects up and running with Docker and many other tools in minutes
28 stars 23 forks source link

CONFIG_SYNC_DIRECTORY is used but is deprecated #18

Closed rsanzante closed 4 years ago

rsanzante commented 4 years ago

CONFIG_SYNC_DIRECTORY constant is deprecated but it is used in source code.

$ grep CONFIG_SYNC_DIRECTORY * -r -n5 
scripts/composer/ScriptHandler.php-39-    if (!$fs->exists($drupalRoot . '/sites/default/settings.php') and $fs->exists($drupalRoot . '/sites/default/default.settings.php')) {
scripts/composer/ScriptHandler.php-40-      $fs->copy($drupalRoot . '/sites/default/default.settings.php', $drupalRoot . '/sites/default/settings.php');
scripts/composer/ScriptHandler.php-41-      require_once $drupalRoot . '/core/includes/bootstrap.inc';
scripts/composer/ScriptHandler.php-42-      require_once $drupalRoot . '/core/includes/install.inc';
scripts/composer/ScriptHandler.php-43-      $settings['config_directories'] = [
scripts/composer/ScriptHandler.php:44:        CONFIG_SYNC_DIRECTORY => (object) [
scripts/composer/ScriptHandler.php-45-          'value' => Path::makeRelative($drupalFinder->getComposerRoot() . '/config/sync', $drupalRoot),
scripts/composer/ScriptHandler.php-46-          'required' => TRUE,
scripts/composer/ScriptHandler.php-47-        ],
scripts/composer/ScriptHandler.php-48-      ];
scripts/composer/ScriptHandler.php-49-      drupal_rewrite_settings($settings, $drupalRoot . '/sites/default/settings.php');     

This variable was deprecated, see this change registry: The sync directory is defined in $settings and not $config_directories .

As a result of simplifying configuration sync directory configuration we have also deprecated config_get_config_directory(), CONFIG_SYNC_DIRECTORY and drupal_install_config_directories(). [...] The constant CONFIG_SYNC_DIRECTORY has no replacement because it is not necessary anymore.

I guess we should just remove lines from 43 to 49 because $settings['config_directories'] doesn't exist anymore.

dlopez-akalam commented 4 years ago

Thank you for reporting it. Here is how is done on the drupal-composer/drupal-project package: https://github.com/drupal-composer/drupal-project/commit/04a3fe08d35bfdbdcb9718556fbe8181cd111ff0

dlopez-akalam commented 4 years ago

Fixed