Closed (fixed)
Project:
Drupal core
Version:
11.3.x-dev
Component:
extension system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
30 Sep 2025 at 03:43 UTC
Updated:
9 Dec 2025 at 18:29 UTC
Jump to comment: Most recent
Comments
Comment #2
berdirI haven't look at the test, many other tests set up modules in vfs instead of changing real files, would that be an option here?
Comment #3
nicxvan commentedWe can't use VFS.
It's specifically a test for symlinks and vfs does not support symlinks.
Comment #4
mstrelan commentedIf I'm following this right, the code in question is this:
For a start,
symlink()expects$targetas the first parameter, but I think we're just using the wrong name for the variable. The target is where the symlink points to, which is the file incore/modules. The link we're creating is written to$this->siteDirectorywhich should be insites/simpletest, which should be gitignored.If I'm mistaken, can you point to where the test is writing to a file that is checked in to the repository?
Comment #5
mstrelan commentedOh I found it.
In \Drupal\KernelTests\KernelTestBase::tearDown
This is passed to
\Drupal\Core\File\FileSystem::deleteRecursiveand it's applied to every file. Perhaps we could just fix that to now chmod symlinks? I'm curious why we need to chmod a file that is going to be deleted anyway, if we have permission to set the permissions then surely we can just delete it?Comment #7
mstrelan commentedComment #8
nicxvan commentedI thought this was actually a different issue, but it works!
I'm glad you found that (ironically I worked on both issues you tracked down).
I'm going to ping @alexpott since he worked on the bit introduced here and make sure I'm not forgetting something.
This looks pretty straightforward though.
https://git.drupalcode.org/project/drupal/-/commit/ed78b812e179b3bc52371... and #3482449: \Drupal\Core\File\FileSystem::deleteRecursive() will follow symlinks and remove files outside the directory it is deleting for reference.
Comment #9
nicxvan commentedWhoops didn't mean to change status
Comment #10
nicxvan commentedI think we can mark this now. Looks good to me and @alexpott signed off too.
I've updated credit.
Comment #11
longwaveThis probably is eligible for backport but not sure it's worth the effort.
Committed and pushed cb176c7426f to 11.x and 1b5f6d95e32 to 11.3.x. Thanks!