Skip to content

[Validator] Improve Image constraint invalid mime type message #16663

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 1, 2022
Merged

[Validator] Improve Image constraint invalid mime type message #16663

merged 1 commit into from
Apr 1, 2022

Conversation

mdoutreluingne
Copy link
Contributor

@mdoutreluingne mdoutreluingne commented Mar 28, 2022

Fixes #16662

Changed the default message in case of incorrect mime type for the image constraint.

From 6.1 we will replace This file is not a valid image. with this The mime type of the file is invalid ({{ type }}). Allowed mime types are {{ types }}..

@javiereguiluz
Copy link
Member

Thank you Maxime.

@fancyweb
Copy link
Contributor

fancyweb commented Apr 4, 2022

It's a little bit more complicated than that.

This file is not a valid image. is still the default value but not when the allowed mime types are only a subset of image/*, for example: ->mimeTypes = ['image/jpeg', 'image/gif'];.

@mdoutreluingne
Copy link
Contributor Author

mdoutreluingne commented Apr 4, 2022

Sorry for misunderstanding this new change, indeed This file is not a valid image. is still the default message.

I will correct this as soon as possible.

javiereguiluz added a commit that referenced this pull request Apr 26, 2022
…age option (mdoutreluingne)

This PR was squashed before being merged into the 6.1 branch.

Discussion
----------

[Validator] Fix of the description of the mime type message option

In this PR, I corrected the mistake I made [here.](#16663)

I used the table of parameters of the `File` constraint to explain the different parameters in the `Image` constraint.

Can you do a review please?

`@fancyweb` ready for review :)

Commits
-------

b557833 [Validator] Fix of the description of the mime type message option
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants