Can not upload using core file upload element (no dropzonejs) because of false validation errors

Created on 20 April 2023, over 1 year ago

Problem/Motivation

After validateForm() was implemented in Drupal\media_bulk_upload\Form\MediaBulkUploadForm for
📌 Add form validation to inform other module to valid the new uploaded files Fixed , bulk uploading files using the core file upload (not DropzoneJS) fails validation. This occurs because validateForm() assumes that the form state values for the file uploads are structured how the dropzoneJS element provides them. In addition, the validation implemented is unnecessary for the core element, because it already calls the file_validate hooks.

Steps to reproduce

  1. Install Drupal with standard profile
  2. Install media_bulk_upload
  3. Add a media bulk upload configuration (be sure to set Upload location)
  4. Go to /media/bulk-upload
  5. Drag files to the file upload field (or use the widget to select files)
  6. Observe that there is an No media files have been provided. error, even though uploaded images are now listed
  7. Observe that the error prevents form submit

Proposed resolution

The functionality in validateForm applies only to the dropzoneJS widget, so it should be moved to the media_bulk_upload_dropzonejs submodule.

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

3.0

Component

Code

Created by

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

Comments & Activities

Production build 0.71.5 2024