Home › Forums › Ticket Products › Eventbrite Tickets › Invalid Country Code when adding new event to Eventbridge via WordPress (Canada)
- This topic has 5 replies, 2 voices, and was last updated 11 years ago by Barry.
-
AuthorPosts
-
March 29, 2013 at 5:03 pm #44396WesParticipant
When I create an event in Canada, the eventbrite portion fails with an “Invalid Country Code” error. If I change the venue to the United States it works fine.
So, I’ve narrowed it down to the following code, and have hacked up a quick fix for myself, but haven’t had time to debug it properly. It looks like self::get_country_code() is returning a bunk value (but not NO value, that would be a different error), to test (and quick fix) I forced the value to “CA” and it works fine.
Line 828 of tribe-eventbrite.class.php —
$country_code = self::get_country_code( $event_id );
if ( $country_code ) {
$requestParams .= ‘&country_code=CA’;// . urlencode( $country_code );
}
return $requestParams;April 1, 2013 at 9:16 am #44499BarryMemberHi Wes,
Certainly do let us know if you discover anything further. For my own part I tried to recreate this and so long as the venue address was a valid Canadian address $country_code is properly set to CA so I’m not quite sure what’s going on in your case … are you able to share the address data for affected venues?
April 1, 2013 at 4:29 pm #44546WesParticipantYep:
205 – 810 Quayside Dr, New Westminster, BC, V3M 6B9, Canada
April 2, 2013 at 1:20 pm #44670BarryMemberI’m not able to offer an explanation … that address works for me – this is a screenshot of the settings I entered (just in case it happens that you are populating the fields in a different order or something) – and there was no issue with the country code.
I’m guessing your fairly at home working with code since you patched it yourself – are you able to share what the actual value of the $country_code variable is when returned by Events_Ticket_PRO::get_country_code()?
April 3, 2013 at 2:03 pm #44791WesParticipantOK, Did some more digging.
Early on in the site’s development, I tried to shorten the Countries list (Use a custom list of countries) to just Canada and the USA, that’s when I noticed the issue (tried CAN, Canada; Canada, Canada; and CAN, Canada. So I wiped out that setting and chose Canada from the standard list of countries as my default. Even though the custom list was removed, this snippet remained in my wp_options table.Snippet from tribe_events_calendar_options:
s:14:”defaultCountry”;a:2:{i:0;s:6:”Canada”;i:1;s:6:”Canada”;}I wiped out the settings and it’s back to normal. Thanks for your help. There is some sort of bug when changing that setting, as it did not actually clear it or reset my defaultCountry based on the country lists (probably because the Country Names are the same.
Anyways, All fixed for me. Thanks.
April 3, 2013 at 4:05 pm #44806BarryMemberOK, that’s the main thing.
I won’t take that forward as a bug because – customizations notwithstanding – that setting seems to work fine for me, so I tend to think this is a bit of a fringe case – but we definitely appreciate you checking back in here.
Since it seems like we’re all sorted I’ll close this thread in a couple of days unless you have any further points/concerns.
Cheers,
Barry
-
AuthorPosts
- The topic ‘Invalid Country Code when adding new event to Eventbridge via WordPress (Canada)’ is closed to new replies.