File replace toggles file status from permanent to temporary

Created on 30 October 2023, 8 months ago

Problem/Motivation

Uploading a new file when using the "Replace existing file" feature causes the initial file to be uploaded with the status of permanent. However, after replacing the file again with an identically named file it changes the file status to temporary in the file_manged table. If you repeat this process again it changes it back to permanent and then temporary and continuing the cycle.

Steps to reproduce

  1. Create a new media entity type.
  2. Add a file field and enable the "replace existing file" on that field.
  3. Create a new entity, give it a file with name, check the file_manged table and take note that it's permanent.
  4. Edit that entity, replace the file with the same file, check the file_managed table and notice that the status is now temporary.

Proposed resolution

Add a conditional check for temporary, and set permanent and save if true.

πŸ› Bug report
Status

Needs review

Version

3.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States j-barnes

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

Comments & Activities

Production build 0.69.0 2024