Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
If you want the installer to create the active configuration directory (currently complete used) but specify a staging directory - you can't. This situation is likely to be quite common as the staging directory is the one we advise people to keep in git.
This issue will allow a user to add
$config_directories['staging'] = 'staging2';
to settings.php
before running the installer.
Proposed resolution
Update the active&stage directory creation code, so that it creates new directory if not set already.
Remaining tasks
Commit
User interface changes
None
API changes
None
Original report by @alexpott
Comment | File | Size | Author |
---|---|---|---|
#5 | 2384853.3.patch | 2.4 KB | alexpott |
#5 | 1-3-interdiff.txt | 1.45 KB | alexpott |
#1 | 2384853.1.patch | 2.05 KB | alexpott |
Comments
Comment #1
alexpottThis is especially helpful if using https://www.drupal.org/project/config_installer
Comment #2
alexpottComment #3
vijaycs85Don't we want to do this:
As
$settings['config_directories'] =
removes other elements?Comment #5
alexpottYep you're right :)
Comment #6
vijaycs85Looks good to me.
Just one final question - Do we need to worry this code in terms of security?
as this allows any key to be added as directory, what if we add
$config_directories['hack_dir'] = 'staging2';
and we add as directory create any security issue?Comment #7
alexpottre #6: In order to add a directory you would need to either affect $GLOBALS somehow or have access to settings.php - so I'm pretty sure we are not adding any security issues here.
Comment #8
vijaycs85@alexpott explained on IRC, it is more about global variable and if one gained $global access can do much more than hacking this file. So this is good to go.
Comment #10
alexpottThat test fail looks unrelated and it passes locally.
Comment #13
vijaycs85Comment #15
vijaycs85as per #6
Comment #16
vijaycs85Comment #17
vijaycs85Comment #18
vijaycs85Comment #19
catchThis looks straightforward. Committed/pushed to 8.0.x, thanks!