- Status changed to Needs review
over 1 year ago 10:46pm 13 April 2023 - Status changed to Needs work
over 1 year ago 11:24pm 13 April 2023 - ๐บ๐ธUnited States smustgrave
Thank you for reporting and the detailed issue summary
Can you provide a test case showing the issue too
Thanks.
- ๐บ๐ธUnited States Jandor64
Hello @smustgrave I have attempted to create a test for this, however it depends on the write folder being at the top level of the webserver and the standard docker image for creating tests doesn't allow modifying that location.
- ๐ณ๐ฟNew Zealand claw
I've independently just discovered this, and can confirm it also occurs in Drupal 10 (10.2.1)
I also came across this on Pantheon - is_dir('public://x/x/files') is always TRUE.
For me, this caused problems with generating image style derivative images - FileSystem::prepareDirectory() would not create the directory (because it appears to exist), and image generation would fail with the following message:
TypeError: imagejpeg(): Argument #2 ($file) must be a file name or a stream resource, bool given in imagejpeg() (line 258 of core/modules/system/src/Plugin/ImageToolkit/GDToolkit.php).
The patch works for me for Drupal 9.5.
- ๐บ๐ธUnited States dandaman
Last week during a Drupal Campโs contribution day, I tried to learn how to write tests to try to get this to move forward. But I definitely had some issues getting the testing suite running locally. Maybe Iโll try again at some point when I have more time.
- ๐บ๐ธUnited States smustgrave
Based on your setup thereโs some good documentation examples out there. Example I use ddev and phpstorm so this helped me
https://www.previousnext.com.au/blog/running-and-debugging-phpunit-tests...
Also if on Drupal community slack there is a channel #testing where someone may be of some help.