Jump to content

"phone_mobile is invalid." error even when no value is supplied


Recommended Posts

Hi, I'm using v1.6.0.6 and the One Page Checkout. When I try to save an address record in the Instant Checkout section, the error 'phone_mobile is invalid.' is displayed regardless of what I type in. The back-office settings in Preferences>Customers page have phone number as optional.

 

 

I can't go live with this issue still unresolved.

 

http://abfigures.com

 

Thanks for your help,

 

Alan

 

 

Link to comment
Share on other sites

How quickly things drop onto the second page in this forum.

 

Does anyone have any experience with this bug and can suggest a way forward? I am prepared to cut out the code that validates the phone numbers, but I have no clue where I might find it.

Link to comment
Share on other sites

Hi Vekia,

 

I'm using v1.6.0.6 and a Template Monster skin.

 

The reason it works at the moment was because I needed to do somethign urgent so I cut out the call to the validation code in Address.php:

 

    public static $definition = array(
        'table' => 'address',
        'primary' => 'id_address',
        'fields' => array(
            'id_customer' =>         array('type' => self::TYPE_INT, 'validate' => 'isNullOrUnsignedId', 'copy_post' => false),
            'id_manufacturer' =>     array('type' => self::TYPE_INT, 'validate' => 'isNullOrUnsignedId', 'copy_post' => false),
            'id_supplier' =>         array('type' => self::TYPE_INT, 'validate' => 'isNullOrUnsignedId', 'copy_post' => false),
            'id_warehouse' =>         array('type' => self::TYPE_INT, 'validate' => 'isNullOrUnsignedId', 'copy_post' => false),
            'id_country' =>         array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true),
            'id_state' =>             array('type' => self::TYPE_INT, 'validate' => 'isNullOrUnsignedId'),
            'alias' =>                 array('type' => self::TYPE_STRING, 'validate' => 'isGenericName', 'required' => true, 'size' => 32),
            'company' =>             array('type' => self::TYPE_STRING, 'validate' => 'isGenericName', 'size' => 64),
            'lastname' =>             array('type' => self::TYPE_STRING, 'validate' => 'isName', 'required' => true, 'size' => 32),
            'firstname' =>             array('type' => self::TYPE_STRING, 'validate' => 'isName', 'required' => true, 'size' => 32),
            'vat_number' =>             array('type' => self::TYPE_STRING, 'validate' => 'isGenericName'),
            'address1' =>             array('type' => self::TYPE_STRING, 'validate' => 'isAddress', 'required' => true, 'size' => 128),
            'address2' =>             array('type' => self::TYPE_STRING, 'validate' => 'isAddress', 'size' => 128),
            'postcode' =>             array('type' => self::TYPE_STRING, 'validate' => 'isPostCode', 'size' => 12),
            'city' =>                 array('type' => self::TYPE_STRING, 'validate' => 'isCityName', 'required' => true, 'size' => 64),
            'other' =>                 array('type' => self::TYPE_STRING, 'validate' => 'isMessage', 'size' => 300),
            'phone' =>                 array('type' => self::TYPE_STRING, 'validate' => 'isPhoneNumber', 'size' => 32),
//            'phone_mobile' =>         array('type' => self::TYPE_STRING, 'validate' => 'isPhoneNumber', 'size' => 32),
            'dni' =>                 array('type' => self::TYPE_STRING, 'validate' => 'isDniLite', 'size' => 16),
            'deleted' =>             array('type' => self::TYPE_BOOL, 'validate' => 'isBool', 'copy_post' => false),
            'date_add' =>             array('type' => self::TYPE_DATE, 'validate' => 'isDateFormat', 'copy_post' => false),
            'date_upd' =>             array('type' => self::TYPE_DATE, 'validate' => 'isDateFormat', 'copy_post' => false),
        ),

 

Not the perfect solution and it probably leaves me exposed to a SQL Injection attack, but at least it accepts a person's address now. I will remove the Mobile_Phone field from any .TPL file as well and that should stop any risk. It's a hack and slash approach, but deadlines do that to a person. Wish me luck, I go live tomorrow.

 

But if there is a better, more long-term solution, then I'd love to hear it.

Link to comment
Share on other sites

  • 4 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...