aimeos / ai-client-html

Aimeos e-commerce HTML client components
https://aimeos.org
GNU Lesser General Public License v3.0
154 stars 58 forks source link

Fix no view available issue when validating fields #202

Closed maynor96 closed 7 months ago

maynor96 commented 1 year ago

Hello Aimeos,

I have added validation for the phone field in client.php of my theme: image

When I do a test and intentionally put an incorrect value in the telephone to validate that the rule that I put in the configuration works, it redirects me to a page without content and the error appears: No view available. image

This is caused by a throw new, which does not allow executing the init function where the view is set.

For it, I have replaced the throw new with a return false;

Now when the validation fails, the page reloads and shows me correctly the field that has not passed the regex validation that I have configured. image

I look forward to your comments,

Regards!

aimeos commented 1 year ago

When removing the exception, the error message seems to be not displayed any more ("At least one billing address field is missing"). Can you confirm?

maynor96 commented 1 year ago

That's right! that message is not displayed ("At least one billing address part is missing or invalid"), only this message is displayed: "At least one delivery address part is missing or invalid": image

aimeos commented 1 year ago

Can you provide a patch to set the view before checking the fields?

maynor96 commented 1 year ago

I changed the order but it didn't work: image image

aimeos commented 7 months ago

The error doesn't occur in the upcoming 2024.04 version any more