Jump to content

Recommended Posts

Posted

WRT: http://www.blesta.com/forums/index.php?/topic/807-checkout-with-custom-field/

 

After applying Cody's fix, I now get error:

CustomFieldName is in an invalid format.

 

My field asks for an IP address.  I've used these two regex's

 

/^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/

and

/\b(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b/

 

both of these work once a client is created manually, just not when they try and checkout and create an account.

 

Not sure if bug so I posted it here first.

 

Ideas?

Posted

Try this mate:

 

/^\(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/
I'm only guessing though since i'm not the best at these.
Posted

That does not work in either scenario (when the client is created manually and then updates their info, or trying to check out as a new customer)

 

The two regex's I posted work when a client is already created and updates their information.  It just generates and invalid message during checkout with new clients.

Posted

That does not work in either scenario (when the client is created manually and then updates their info, or trying to check out as a new customer)

 

The two regex's I posted work when a client is already created and updates their information.  It just generates and invalid message during checkout with new clients.

Try this mate:

 

^([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$

That one looks more like the one I use for the date of birth.

Posted

I had to wrap that in // for it to work with existing clients, but still errors out on using the order form to create a new client account

Posted

I had to wrap that in // for it to work with existing clients, but still errors out on using the order form to create a new client account

I'll try it on my side.

Posted

I had to wrap that in // for it to work with existing clients, but still errors out on using the order form to create a new client account

 

What errors do you get? I keep getting errors on this one field it's winding me up, however the IP one works fine and my date of birth it's just this one field called "How did you hear about us?" It's the first one on the form. (Is yours first?)

 

I get this error:

 

How did you hear about us? is set to an invalid value.

How did you hear about us? is in an invalid format.

 

on: http://billing.licensecart.com/plugin/order/main/signup/register

 

But it's a dropdown box with values in it.

 

preview video: http://screencast.com/t/8XuBkxOvCjNN

Posted

Yes, mine is the first (and only) one on the form.

Bet that's the issue haha :D just need Paul, Cody or Tyson to confirm this and hope they issue a fix lol.

Posted

Sounds like a bug with how the order form passes custom field values for validation. I believe custom fields are validated one at a time, so even if all of them are erroneous, only the first error would show.

Posted

Sounds like a bug with how the order form passes custom field values for validation. I believe custom fields are validated one at a time, so even if all of them are erroneous, only the first error would show.

 

 

This could be true.  Just wanted to note that mine shouldn't be erroring at all.  It works fine when editing "My Info" once the account is already created. 

Posted

Sounds like a bug with how the order form passes custom field values for validation. I believe custom fields are validated one at a time, so even if all of them are erroneous, only the first error would show.

 

What would be the best way to go about this until the 3.0.1 mate? make a blank field for the first or will it still show a error?

Or shall we just disable them all now haha.

Posted

This custom field is the cornerstone of my business lol.  I can't disable it.  I'm supposed to launch in less than 2 hours :'(

Posted

I think Cody's fix from the other thread should be

 

update /app/models/clients.php (line 89):

$this->setCustomField($field->name, $client_id, isset($vars['custom']) && array_key_exists($field->name, $vars['custom']) ? $vars['custom'][$field->name] : null);

to

$this->setCustomField($field->id, $client_id, isset($vars['custom']) && array_key_exists($field->id, $vars['custom']) ? $vars['custom'][$field->id] : null);
Posted

I think Cody's fix from the other thread should be

 

update /app/models/clients.php (line 89):

$this->setCustomField($field->name, $client_id, isset($vars['custom']) && array_key_exists($field->name, $vars['custom']) ? $vars['custom'][$field->name] : null);

to

$this->setCustomField($field->id, $client_id, isset($vars['custom']) && array_key_exists($field->id, $vars['custom']) ? $vars['custom'][$field->id] : null);

 

I can confirm this has resolved my issue.

 

Thanks for the great support guys!

Posted

I think Cody's fix from the other thread should be

 

update /app/models/clients.php (line 89):

$this->setCustomField($field->name, $client_id, isset($vars['custom']) && array_key_exists($field->name, $vars['custom']) ? $vars['custom'][$field->name] : null);

to

$this->setCustomField($field->id, $client_id, isset($vars['custom']) && array_key_exists($field->id, $vars['custom']) ? $vars['custom'][$field->id] : null);

 

That fixed it thank you mate,

 

Also this IP Address Regex I found that worked with my IP address:

/^(??:1\d?\d|[1-9]?\d|2[0-4]\d|25[0-5])\.){3}(?:1\d?\d|[1-9]?\d|2[0-4]\d|25[0-5])$/
Guest
This topic is now closed to further replies.
×
×
  • Create New...