File upload field and remove selected broken when one of many files is invalid

Created on 12 June 2019, about 6 years ago
Updated 11 July 2025, 2 days ago

Steps to Reproduce:

1. Create a file field that accepts more than 1 file or infinite
2. Add some permitted file extensions
3. Go to the form
4. Upload multiple files at the same time with some files with accepted extension and one that is not

Currently:

The files and upload button show up in a table cell.

The upload field no longer works via ajax nor does it work if you add a file and save the form.

The `Remove selected` button does not reflect the checkboxes. Regardless of which file I select the `Remove Selected` button removes all the files uploaded.

Expected Result:

The upload field should upload new files and the Remove selected button should only remove checked files.

The reason the upload field no longer works is because the upload button is no longer here:

$(event.target).closest('.js-form-managed-file').find('.js-form-submit[data-drupal-selector$="upload-button"]').trigger('mousedown');

I haven't dug into the remove selected button yet.

🐛 Bug report
Status

Postponed: needs info

Version

11.0 🔥

Component

file system

Created by

🇨🇦Canada jerrylow

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

Comments & Activities

Not all content is available!

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

  • 🇮🇳India mohit_aghera Rajkot

    I came across this issue while triaging in bugsmash initiative.

    I tried to reproduce the issue in latest 11.x and on claro theme.
    I seems file upload widget is refactored and and we don't see those errors/remove buttons anymore.

    I validated using following steps:
    - Install standard profile.
    - Add file upload field that allows txt pdf
    - Create content and try to upload files like .patch or .csv
    - I was not able to upload any files at all.
    I see following error message

    I think we need proper steps to reproduce the issue.

Production build 0.71.5 2024