How to add an additional file validator

Created on 30 August 2023, 10 months ago

Problem/Motivation

I was wondering if there is a recommended technique for a contrib module to add an additional validator to the file entity browser upload widget.

I already have this functionality working with core file and image fields, by adding the validator to the #upload_validators array when #type === 'managed_file', and would like to get this working for sites that use entity browser as well.

I tried adding my validator to $element['entity_browser']['#widget_context']['upload_validators'] but this didn't seem to work with file entity browser's dropzone upload widget.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

πŸ’¬ Support request
Status

Active

Version

1.0

Component

Miscellaneous

Created by

πŸ‡ΊπŸ‡ΈUnited States mfb San Francisco

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

Comments & Activities

Production build 0.69.0 2024