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

stop contact form process if there's an error in the controller #78

Merged
merged 1 commit into from
Jul 4, 2024

Conversation

aeyoll
Copy link
Contributor

@aeyoll aeyoll commented May 28, 2024

Questions Answers
Description? Prevent the contact form from being sent if there's an error in the controller. It allows a module to add additional form validation
Type? improvement
BC breaks? no
Deprecations? no
Fixed ticket? -
How to test? -

Copy link
Contributor

@Hlavtox Hlavtox left a comment

Choose a reason for hiding this comment

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

Not sure about this. In my opinion, it's pretty annoying when you submit the form, it tells you an error, you fix it and it tells you another error. 🤷‍♂️

@aeyoll
Copy link
Contributor Author

aeyoll commented May 28, 2024

Your description matches how it works at the moment: if there are two errors in the form, only the first one is displayed. My PR displays all errors + display possible errors emitted by a module using a hook.

@Hlavtox
Copy link
Contributor

Hlavtox commented May 28, 2024

@aeyoll Yes, you are right, I should see eye doctor. 😄😄😄

@boherm
Copy link
Member

boherm commented May 28, 2024

LGTM too, thanks @aeyoll ;)

@florine2623
Copy link
Contributor

Hello @aeyoll

Could you provide a How to test for your PR please ?

Thanks!

@florine2623
Copy link
Contributor

friendly reminder @aeyoll

@aeyoll
Copy link
Contributor Author

aeyoll commented Jul 4, 2024

Hello @florine2623,

You can test it by installing this module: https://github.com/aeyoll/pow-captcha-for-prestashop. It's a custom captcha module, it doesn't matter if its configured or not, since we want to test the failing case. It just need to be enabled.

Before the update of "contactform", you won't see the captcha error message. With this branch of "contactform", you'll see the captcha error message.

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 @aeyoll ,

Thanks for the details.

I tested the standard case.
All errors are displayed at once, instead of after each check.
Screenshot 2024-07-04 at 12 28 44

It is QA ✅ !
Thanks!

@florine2623 florine2623 self-assigned this Jul 4, 2024
@nicosomb nicosomb added this to the 4.4.3 milestone Jul 4, 2024
@nicosomb nicosomb merged commit 98f4722 into PrestaShop:dev Jul 4, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
6 participants