ai-client-html icon indicating copy to clipboard operation
ai-client-html copied to clipboard

Fix no view available issue when validating fields

Open maynor96 opened this issue 2 years ago • 4 comments

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!

maynor96 avatar Feb 23 '23 05:02 maynor96

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?

aimeos avatar Feb 26 '23 09:02 aimeos

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

maynor96 avatar Feb 27 '23 03:02 maynor96

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

aimeos avatar Feb 27 '23 07:02 aimeos

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

maynor96 avatar Mar 01 '23 07:03 maynor96

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

aimeos avatar Apr 08 '24 15:04 aimeos