Add replace option

Created on 15 September 2021, over 3 years ago
Updated 28 March 2025, about 1 month ago

Problem/Motivation

Currently files are moved with the replace flag set to 'rename'. In cases where developers are sure that relevant file URLs will be unique (e.g. a filefield_paths pattern or other presave alter that ensures uniqueness), it might be good to add an option to replace existing files, if there are any temp files or files from previous (perhaps unsuccessful) file operations, to ensure the file URL remains constant through publishing/unpublishing/republishing.

Proposed resolution

Attached patch adds a media_files_handler.settings config entity with a 'replace' option, default false. No UI or config creation for existing installations - devs would need to manually add a media_files_handler.settings.yml in the config sync directory.

✨ Feature request
Status

Needs review

Version

1.0

Component

Code

Created by

πŸ‡¨πŸ‡¦Canada bgilhome Victoria

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

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024