You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add a file (not png or svg) to the field using the "choose existing" option
Note that the file is added to the field without raising a validation error.
NOTE the setAllowedMaxFileNumber is probably unrelated, and setUploadEnabled is not necessary.
Possible Solution
No response
Additional Context
No response
Validations
Check that there isn't already an issue that reports the same bug
Double check that your reproduction steps work in a fresh installation of silverstripe/installer (with any code examples you've provided)
Notes
That validation is currently handled by the upload validator - which is for validating uploaded files, not existing files
It would make sense for the allowed extensions validation to be triggered for existing files. It's not uncommon for business logic to be "this relation should only be files of this type" (e.g. videos only, or documents only, etc)
This is a fairly substantial change in logic, it should probably be introduced in a minor release rather than a patch so people can be alerted to this change via the changelog.
Acceptance criteria
User is blocked from selecting pre-existing files that do not match the allowed extensions.
All file validation rules are honoured when selecting a pre-existing file
The Browser upload file dialog stops you from uploading files that do not have one of the allowed extensions. (What should happen we have the default validation rules? Should all the file upload input include all the CMS allowed types?)
UX questions
What happens if you select a file that does not meet the validation criteria? How do we communicate to the user that they cannot select this file?
The text was updated successfully, but these errors were encountered:
GuySartorelli
changed the title
UploadField validation issue when setUploadEnabled=false
UploadField doesn't validate allowed extensions with "choose existing" option
Jan 18, 2024
Module version(s) affected
2.1.3
Description
Allowed extensions validation for
UploadField
does not kick in when using the "choose existing" optionBrowse.Asset.mp4
How to reproduce
png
orsvg
) to the field using the "choose existing" optionNOTE the
setAllowedMaxFileNumber
is probably unrelated, andsetUploadEnabled
is not necessary.Possible Solution
No response
Additional Context
No response
Validations
silverstripe/installer
(with any code examples you've provided)Notes
Acceptance criteria
UX questions
The text was updated successfully, but these errors were encountered: