How to add an additional file validator

Created on 30 August 2023, about 2 years 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

  • Issue created by @mfb
  • Status changed to Postponed: needs info 12 days ago
  • πŸ‡¬πŸ‡§United Kingdom d.fisher

    @mfb I'm sorry no one has replied to you. I've just become a maintainer of this module. Did you ever manage to find a solution to this? If so would you mind reporting back with the fix? If not we can look into this a bit further. Marking as postponed (maintainer needs more info) until we get a reply. Thank you!

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

    @dfisher I still don't know how to do this. I may have missed something obvious as I don't use this module per se, was just trying to make my contrib module compatible with it.

Production build 0.71.5 2024