Default Country on Submit an Event form

Home Forums Calendar Products Community Events Default Country on Submit an Event form

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #1143976
    Sean
    Participant

    Hi,

    Hoping I can get a status update on this bug. I’ve been following the release notes but didn’t see anything about a fix being released for this even though last month a fix was said to be released in the next couple maintenance releases. Where its been 3 releases since then, I just wanted to see if this was fixed and simply either left out of the release notes or if I somehow missed it in the notes?

    Thank you,
    Karly

    #1144019
    Brook
    Participant

    Howdy Karly,

    It’s great to see you again! I hope things have been going smooth.

    I checked in on the status of that ticket and nothing has changed since Geoff’s last update. This is not yet slotted for a release. However I do have a question in to one of our devs requesting a little more info, and I will get back to you with that when he does.

    Please let me know if you have any follow up questions in the mean time. Cheers!

    – Brook

    #1144151
    Sean
    Participant

    Thanks Brook and hope all is well. If this isn’t going to be released next week in the next release, it would be great if there’s a workaround to make the United States the default Country for the Venue on the Community Events Submit an Event form. Reason being is that we are stuck on an old version until this is fixed, simply because it would be a downgrade for the UX.

    Even if there’s a workaround to make the United States the default selection with it being the only option for the Venue Country (user can’t change it to another country) that would work fine since we only include USA-based events on our calendar anyways.

    Best regards,
    Karly

    #1144235
    Brook
    Participant

    Yeah I can definitely walk you through that modification if you’re keen to make it.

    I don’t recall if we have yet walked you through creating theme overrides. But if not then you will want to first familiarize yourself with the Themer’s Guide . With that knowledge in hand will create an override for /the-events-calendar-community-events/src/views/community/modules/venue.php . On line ~36 you will see

    $venue_country       = tribe_get_country();

    Swan this for own country. Use the country’s full name as it would appear in the country picker drown down, then wrap it in quotes. For example:

    $venue_country = 'United Kingdom';

    Would select the UK.

    Did that do the trick for now? I have not yet heard back from the developer. I am not sure when or even if this behavior will change. I do not fully understand why we changed it in the first place, hence my question in to our lead developer. It appears that someone felt the old behavior was in fact a bug and very purposefully changed it to the current. My question for the developer is basically: Why? I don’t grasp the reasoning behind this. That said your ticket to change it back is still open, but since it has not been slotted for and is marked as a feature rather than a bug it could be many months before it gets addressed.

    • Brook
    #1144953
    Sean
    Participant

    Hi Brook,

    I have done some template overrides before, but thank you for double checking!

    I tried changing the code you highlighted, but I’m still seeing the full list of countries when opening the Venue Country dropdown. Is there another place on the template that I should be changing to force the United States as the default (and only) option for the venue country dropdown?

    Thanks for your help,
    Karly

    #1144987
    Brook
    Participant

    Oh shucks, I thought you were just trying to select which country was the default, not remove the other options. If you’re going to remove every option but one from the drop down, why I don’t just walk you through hiding the drop down?

    We’re in the right file for that. If you scroll down in that theme override you just created, to line ~110, you will see this:

    <?php if ( ! tribe_community_events_single_geo_mode() ): ?>
       <tr class="venue linked-post">
          <td>
             <label for="EventCountry">
                <?php esc_html_e( 'Country', 'tribe-events-community' ); ?>:
             </label>
          </td>
          <td>
             <select class="chosen" name="venue[Country]" id="EventCountry">
                <?php
                foreach ( Tribe__View_Helpers::constructCountries() as $abbr => $fullname ) {
                   echo '<option value="'. esc_attr( $fullname ) .'" ';
    
                   selected( $venue_country == $fullname );
                   echo '>' . esc_html( $fullname ) . '</option>';
                } ?>
             </select>
          </td>
       </tr><!-- .venue -->
    <?php endif; ?>

    You can either delete this, which will cause things to assume that your local country is the default. Or you could replace it with a hidden input that specified the states. Something like:

    <input type="hidden" name="venue[Country]" id="EventCountry" value="United States" />

    Ought to do the same trick. Then all future venues will explicitly state they are in the US, which might be preferred if you want all of your addresses to end with the Country Name.

    Is that what you were looking for?

    Cheers!

    – Brook

    #1145411
    Sean
    Participant

    Hi Brook,

    Thank you very much, this is exactly what I was looking for! Appreciate you taking the time to help with this as well as the background info on the status of the “bug”. Given that the functionality of the default country probably won’t be changing anytime soon, I think I’ll move forward with using this workaround on my production site 🙂

    Thanks again for the superb support!

    Best regards,
    Karly

    #1145548
    Brook
    Participant

    You are welcome!

    The lead dev did get back to me. He has been a bit distracted this week and apologized for the delay.

    Basically there was a side effect of the old behavior that some considered a bug. If you specified a few Venue details as default, then a user submits the form without changing any of them, it creates a new venue with those details. Since our plugin would be unable to distinguish this from a real venue, they decided to stop prefilling the Venue details on the Add Events page. Only the Add Venue page will be prefilled with defaults.

    Obviously though, in like of needs like yours, the above is not a good solution. We are considering some alternatives that will both hopefully address that usability bug and make the set defaults work decent. In the mean time though, this is basically our expected behavior for it to not set the venue’s default content on the Community Add Event page. And I am not yet sure how long it will take for us to come up with a better solution than this.

    Either way your override should do exactly what you wanted, hopefully even better then just one field in the drop down.

    Thanks for getting back Karly.

    • Brook
    #1145657
    Sean
    Participant

    Okay thanks for this additional info on why the functionality was changed. I can see how this would made sense in some cases. Glad that we were able to find a workaround that will work just as well as an official “fix” in the meantime. Thanks again and have a great weekend!

    #1146167
    Brook
    Participant

    You are welcome. I hope you had a great weekend too!

    • Brook
    #1387528
    Courtney
    Member

    We released an update for this issue. Can you update your plugins (preferrably on a staging site) and see if that resolves the issue.

    https://theeventscalendar.com/maintenance-release-week-13-november-2017/

    Thanks
    Courtney ?

Viewing 11 posts - 1 through 11 (of 11 total)
  • The topic ‘Default Country on Submit an Event form’ is closed to new replies.