Invalid Country Code when adding new event to Eventbridge via WordPress (Canada)

Home Forums Ticket Products Eventbrite Tickets Invalid Country Code when adding new event to Eventbridge via WordPress (Canada)

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #44396
    Wes
    Participant

    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;

    #44499
    Barry
    Member

    Hi 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?

    #44546
    Wes
    Participant

    Yep:

    205 – 810 Quayside Dr, New Westminster, BC, V3M 6B9, Canada

    #44670
    Barry
    Member

    I’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()?

    #44791
    Wes
    Participant

    OK, 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.

    #44806
    Barry
    Member

    OK, 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

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Invalid Country Code when adding new event to Eventbridge via WordPress (Canada)’ is closed to new replies.