Skip to content

Commit 41336b7

Browse files
SkywardRayAlexSkrypnyk
authored andcommitted
Update ScriptHandler.php to check for symlinks before creating files 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.
1 parent b7253a6 commit 41336b7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scripts/composer/ScriptHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public static function createRequiredFiles(Event $event) {
5353
}
5454

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

0 commit comments

Comments
 (0)