Skip to content
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

New error handling for unsupported image types #102

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

buggyzap
Copy link

Questions Answers
Description? I have added a new error for users who upload a file that is not supported in extensions and/or mimetype.
Type? improvement
BC breaks? no
Deprecations? no
How to test? Try to upload a new file that is not supported.

If we try to upload a new file that is not a valid image, no errors are shown. Backoffice returns success message and image remain the same. With this little "else" check we can track if the uploaded file was included in supported extensions and/or mimetypes.

nicosomb
nicosomb previously approved these changes Apr 30, 2024
Copy link
Contributor

@florine2623 florine2623 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @buggyzap ,

Thanks for the PR !

The error message is displayed twice. Could you make it so that it appears just once ?

Screenshot 2024-06-06 at 15 55 07

It would also be better to have a message like so : Image format not recognized, allowed formats are: gif, jpg, jpeg, jpe, png, webp.
Screenshot 2024-06-06 at 16 10 37

Thanks!

@florine2623 florine2623 removed their assignment Jun 6, 2024
Copy link
Contributor

@kpodemski kpodemski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ping @buggyzap

I think you didn't need to use $this->displayError :)

@ps-jarvis
Copy link

This pull request seems to contain new translation strings. I have summarized them below to ease up review:

  • Admin.Notifications.Error
    • Image format not recognized, allowed formats are: jpg, gif, jpeg, png.

(Note: this is an automated message, but answering it will reach a real human)

@buggyzap
Copy link
Author

ping @buggyzap

I think you didn't need to use $this->displayError :)

Ok ty

@florine2623 florine2623 self-assigned this Jul 4, 2024
Copy link
Contributor

@florine2623 florine2623 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @buggyzap ,

With your PR, I can't add any slider anymore. The error message is always displayed, whether I upload a supporter or unsupported image type.

When I upload a jpg or png, or any supported format, the error is displayed once.
If I upload an unsupported image format, the error is displayed twice.

Screen.Recording.2024-07-04.at.12.00.58.mov

Could you check please ?
Thanks

@kpodemski
Copy link
Contributor

missclick @boherm ?

@boherm boherm self-requested a review July 4, 2024 12:26
@boherm
Copy link
Member

boherm commented Jul 4, 2024

missclick @boherm ?

I haven't see the Florine's comment.. 😅

@florine2623
Copy link
Contributor

friendly reminder @buggyzap :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Ready for review
Development

Successfully merging this pull request may close these issues.

6 participants