Skip to content

Commit

Permalink
Update ScriptHandler.php to check for symlinks before creating files …
Browse files Browse the repository at this point in the history
…directory

When using drupal inside a docker container it can be useful to make the sites/default/files directory a symlink instead. For example here in the wodby documentation https://wodby.com/docs/stacks/drupal/#files_1

I propose adding a check to is_link to prevent errors caused by $fs->exists not handling symlinks.
  • Loading branch information
SkywardRay authored and AlexSkrypnyk committed May 13, 2024
1 parent 55f4e54 commit 2a222fe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/composer/ScriptHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public static function createRequiredFiles(Event $event) {
}

// Create the files directory with chmod 0777
if (!$fs->exists($drupalRoot . '/sites/default/files')) {
if (!$fs->exists($drupalRoot . '/sites/default/files') && !is_link($drupalRoot . '/sites/default/files')) {
$oldmask = umask(0);
$fs->mkdir($drupalRoot . '/sites/default/files', 0777);
umask($oldmask);
Expand Down

0 comments on commit 2a222fe

Please sign in to comment.