Remove file on original/duplicated paragraph removes the file on all original/duplicated paragraphs

Created on 6 September 2019, almost 6 years ago
Updated 11 June 2025, about 2 months ago

Hi everyone!

When a paragraph gets duplicated it creates new entities with the same values, thus duplicating entities correctly. But for files, which may be inside those entities, there is no duplication of the file, in this case, all duplicate FileItems are referencing the same physical file. which causes an unusual behavior when a user deletes the file, then at the next rebuild of the form the files on the other paragraphs which are referencing the same file will also disappear.

Steps to reproduce the bug:

  1. Create a paragraph type with a file field.
  2. On the form display of the paragraph set the experimental widget and allow the user to duplicate the paragraph.
  3. Assign that paragraph to an entity that you can edit, like node type.
  4. Go to node/add/[node-type] to be able to create a new paragraph instance
  5. Upload a file to the paragraph instance
  6. Duplicate the paragraph instance
  7. Duplicate the paragraph instance (optional)
  8. Remove only one file from one of the duplicated paragraphs
  9. Duplicate any paragraph
  10. All files from duplicated paragraphs are gone.

I will soon upload a patch that I've been working to fix this issue.

🐛 Bug report
Status

Active

Version

1.9

Component

Code

Created by

🇪🇨Ecuador betoaveiga Daule, Guayas

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