Replaced default file is not exits after submitting "Replace default files" form

Created on 7 May 2025, 4 days ago

Problem/Motivation

Getting error the following error message with saving a node:
Drupal\Core\File\Exception\FileNotExistsException: File 'public://2025-05/sample k.pdf' ('.../web/sites/default/files/2025-05/sample k.pdf') could not be copied because it does not exist. in Drupal\Core\File\FileSystem->prepareDestination() (line 441 of .../web/core/lib/Drupal/Core/File/FileSystem.php).

Steps to reproduce

- Having a content type with file field (unlimited and Default file types enabled).
- Add at least 2 types to the field and upload a default file for each type.
- Go to admin/config/media/file_defaults_by_type/ and click edit on the field.
- Upload new file for one of the types (I changed the second type) and submit.
- Now try to create new node
- Select the type that we change the default file for in admin/config/media/file_defaults_by_type/
- When click on "Attach" btn, you see error message on screen "Oops, something went wrong. Check your browser's developer console for more details."
- Check the log, you see the above message.

🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇧🇪Belgium msnassar

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

Comments & Activities

Production build 0.71.5 2024