Files do not exist for stubs created via config

Created on 30 April 2024, 7 months ago
Updated 1 May 2024, 7 months ago

Problem/Motivation

When stubs are created via config, the JSON files are not saved to the public://stubby directory

So when you try to visit the URL for one of these stubs, you see the following error:

Drupal\Core\File\Exception\DirectoryNotReadyException: The specified file 'temporary://fileubLtwr' could not be copied because the destination directory 'public://stubby' is not properly configured. This may be caused by a problem with file or directory permissions. in Drupal\Core\File\FileSystem->prepareDestination() (line 479 of core/lib/Drupal/Core/File/FileSystem.php).

Steps to reproduce

1. create a stub
2. export config
3. import config on a different environment
4. visit the stub URL - the error occurs
5. manually create a new stub via the UI
6. visit the config stub URL - the error no longer occurs

Proposed resolution

tbc - ensure that the directory is created when entities are created, rather than in the StubForm class validate method?

🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇬🇧United Kingdom malcomio

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024