Home › Forums › Calendar Products › Community Events › Default Country on Submit an Event form
- This topic has 11 replies, 4 voices, and was last updated 6 years, 5 months ago by Courtney.
-
AuthorPosts
-
July 25, 2016 at 8:35 pm #1143976SeanParticipant
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,
KarlyJuly 25, 2016 at 11:04 pm #1144019BrookParticipantHowdy 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
July 26, 2016 at 7:22 am #1144151SeanParticipantThanks 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,
KarlyJuly 26, 2016 at 8:42 am #1144235BrookParticipantYeah 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
July 27, 2016 at 7:31 pm #1144953SeanParticipantHi 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,
KarlyJuly 27, 2016 at 10:23 pm #1144987BrookParticipantOh 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
July 28, 2016 at 7:09 pm #1145411SeanParticipantHi 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,
KarlyJuly 29, 2016 at 7:58 am #1145548BrookParticipantYou 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
July 29, 2016 at 12:23 pm #1145657SeanParticipantOkay 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!
August 1, 2016 at 10:41 am #1146167BrookParticipantYou are welcome. I hope you had a great weekend too!
- Brook
November 20, 2017 at 1:36 pm #1387528CourtneyMemberWe 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 ? -
AuthorPosts
- The topic ‘Default Country on Submit an Event form’ is closed to new replies.