Description:
Hi All, I would like to submit you the problem I noted in VirtueMart registration module. When a user fill the form to registate, the field validation routine, exit when try to validate the field type "euvatid". I noted also in the code that there is a break instruction that cause the cycle exit. So the cycle exit allow the user registration without information validation on the other fields.
VirtueMart Version:
1.1.5 stable
Joomla/Mambo Version:
Joomla 1.5.20
Steps to replicate:
1) From admin panel, in user fields management, add a new user field type euvatid not required;
2)Move it in top position;
3)From public site try to register as new user;
4)The registration successful even though the select box "country" was not valorized and required.
Proposed fix(es):
I propose to change the break instruction in the function validate_add of ps_shopper class in the page ps_shopper.php.
This is the original code:
if( $field->required == 0 && empty( $d[$field->name])) {
break; // Do nothing when the EU VAT ID field was left empty
}
This is my suggestion code:
if( $field->required == 0 && empty( $d[$field->name])) {
continue; // Do nothing when the EU VAT ID field was left empty
}
System info:
SO: Linux, php version 5.2.14, mysql version 5.0.91
I hope I was helpful, bye