When adding an image to a collection with a default upload folder configured, the upload will fail with an INTERNAL_SERVER_ERROR (caused by an unsatisfied FK constraint to directus_folders) if that default folder has been deleted earlier.
To Reproduce
As an admin, create a folder through the Files module,
Create a collection with an Image field, set the field's default upload folder to the one created above,
Delete that folder through the Files module,
Go to the Content module and try to add an Image to the collection.
Describe the Bug
When adding an image to a collection with a default upload folder configured, the upload will fail with an
INTERNAL_SERVER_ERROR
(caused by an unsatisfied FK constraint todirectus_folders
) if that default folder has been deleted earlier.To Reproduce
Errors Shown
What version of Directus are you using?
9.11.1
What version of Node.js are you using?
16.15.0
What database are you using?
sqlite 3.38.5
What browser are you using?
Firefox
How are you deploying Directus?
running locally