managed_file HTML5 required validation

Created on 22 January 2018, almost 7 years ago
Updated 17 February 2023, over 1 year ago

Problem/Motivation

Client side validation doesn't work on file input ( https://www.drupal.org/project/clientside_validation/issues/2905554 ).

Proposed resolution

Forward the #required attribute of form field to upload element (see patch).
Since validation for multiple value file fields will be complex, proposed solution is to make it work at-least for single value field.

Remaining tasks

  • update tests / code
  • reviews needed
  • tests required?

User interface changes

HTML5 validations will start working for file input fields.

API changes

N/A

Data model changes

N/A

Created separately instead of commenting in https://www.drupal.org/project/drupal/issues/1174938 as this one is specific for managed_file input and forwarding attributes from field to child element and not actually set the aria attribute.

🐛 Bug report
Status

Needs work

Version

10.1

Component
Form 

Last updated 2 days ago

Created by

🇮🇳India nikunjkotecha India, Gujarat, Rajkot

Live updates comments and jobs are added and updated live.
  • html5

    Implements and supports the use of HTML5.

  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

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.

  • The Needs Review Queue Bot tested this issue. It either no longer applies to Drupal core, or fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".

    Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.

    Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

  • First commit to issue fork.
  • @voleger opened merge request.
  • Status changed to Needs review almost 2 years ago
  • 🇺🇦Ukraine voleger Ukraine, Rivne

    Rerolled #6

  • Status changed to Needs work over 1 year ago
  • 🇺🇸United States smustgrave

    This issue is being reviewed by the kind folks in Slack, #needs-review-queue-initiative. We are working to keep the size of Needs Review queue [2700+ issues] to around 400 (1 month or less), following Review a patch or merge request as a guide.

    As a bug this will need a test case.

Production build 0.71.5 2024