Entity file is not removed while editing a file field before submitting.

Created on 11 November 2024, 3 months ago

Problem/Motivation

The previous entity file is not removed while changing the value.

Steps to reproduce

  1. Use a file field with resumable option enabled.
  2. Create or Modify an entity with the file field.
  3. Upload a file, verify that a file was created (Back office and file)
  4. Remove the file, verify that the file remained. Not the case with a default file field.
  5. Submit entity, the previous uploaded file still there.
🐛 Bug report
Status

Active

Version

2.0

Component

Code

Created by

🇲🇦Morocco fidylalaina

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

Merge Requests

Comments & Activities

  • Issue created by @fidylalaina
  • 🇦🇹Austria hatsch

    I came across this issue because i had a similar Problem.
    I want to replace TUS/Uppy with file_resup on Drupal 10.4.

    Unfortunatly after successful uploading with file_resup i had an error when attaching the file to the field.

    The file used in the {fieldname} field may not be referenced.

    The file was added to file_managed, status was permanent, but did not show up in file_usage.

    with your patch it works as expected. The file is added to the field and shows up in file_usage.

    The strange thing is that i could not reproduce this on a fresh 10.4 install
    but on the actual site the error even occured after disabling all contrib modules.

Production build 0.71.5 2024