knitting

Author Topic: Bug in form registration fields validation  (Read 2188 times)

SuperFra

  • Beginner
  • *
  • Posts: 1
    • Soluzione Ufficio
Bug in form registration fields validation
« on: October 23, 2010, 08:51:43 AM »
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:
Code: [Select]
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:
Code: [Select]
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
http://www.soluzione-ufficio.it - Soluzione Ufficio di Salsano Mario - Vendita, noleggio ed assistenza tecnica di macchine per ufficio

zanardi

  • Development Team
  • Sr. Member
  • *
  • Posts: 848
    • GiBiLogic
Re: Bug in form registration fields validation
« Reply #1 on: November 10, 2010, 15:43:56 PM »
I just uploaded a BETA 4 package for VirtueMart 1.1.6 which should include the fix for this issue.
It's available at http://dev.virtuemart.net/redmine/issues/178
Does anyone care to make a test and then let me know? Thank you.
--
Francesco (zanardi)
http://extensions.gibilogic.com
@gibilogic on Twitter

VirtueMart Forum

Re: Bug in form registration fields validation
« Reply #1 on: November 10, 2010, 15:43:56 PM »