Country select default won’t show "Select Country"

Home Forums Calendar Products Events Calendar PRO Country select default won’t show "Select Country"

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #1072911
    Mad Dog
    Participant

    I think this must have changed in one of the recent updates (major or minor) but now on the Add an Event page, the Country select defaults to the United States. In settings, it’s set for “Select Country.” If I change it to another country, like Albania, it defaults to that country. I change it back to “Select Country” and it defaults to the United States.

    The State dropdown functions just like it should. How do I get the Country to default to “Select Country” again? Am I missing a setting I haven’t had to look at in ages?

    Thanks!
    Mad Dog

    #1073420
    Geoff
    Member

    Howdy MD!

    Hmm, I checked my own settings using the latest versions and was unable to create the same issue.

    Here’s a screenshot of my “Default country” settings in Events > Settings > Default Content.

    And here’s a screenshot of what I see in the event editor when creating a new event.

    Note that in the first screenshot, I also have no default venue selected. Do you happen to have a default venue? If so, set that back to no default and see if it makes a difference.

    Thanks!
    Geoff

    #1073431
    Mad Dog
    Participant

    Hi Geoff–

    Maybe it makes a difference that this is for Community Events. I probably should have posted it there.

    – Under COMMUNITY SETTINGS > Form Defaults I have:
    Venues – Use No Venue/No Default
    Organizer – No Default

    – Under EVENT SETTINGS > DEFAULT I have:
    Venue – No Default
    Organizer – No Default

    – When I go to COMMUNITY > SUBMIT COURSE:
    Under Venue Details – Use New Venue
    Country – United States (!)
    The source code shows Country as: disabled=”disabled”

    If it makes any difference, I have made venue and organizer required fields, but this wasn’t a problem until one of the more recent updates (not sure which one…just heard about it).

    Thanks,
    MD

    #1073836
    Geoff
    Member

    Hey MD,

    That helps a lot! Still, though, I’m unable to create the same issue when no defaults are selected in the Community Events settings. Here’s a screenshot of my Community Events default content settings and the resulting screenshot in the Community Events submission form.

    That doesn’t mean this isn’t an issue–only that we need to dig a little deeper to see why that would be happening. Ultimately, we’re going to need to test for conflicts, so if you could follow the troubleshooting steps and let me know if you notice a difference when the site is in default conditions (as my tests are), then we can start pinpointing where the difference is.

    Thanks!
    Geoff

    #1074062
    Mad Dog
    Participant

    Okay….if I change to the default WP theme it works fine, so it’s something in the theme. The only two functions that I see that could affect it are one to make Venue required and one to change the name of Venue and Organizer. Commenting them out doesn’t help.

    However….and this is odd. Now I see the function to change the name of Venue and Organizer isn’t working anymore! I suspect this too happened with the latest major upgrade and no one noticed. I don’t know that it would affect the default Country problem but this code is no longer working:

    // Change VENUE to LOCATION and ORGANIZER to CONTACT
    function filter_translations($translation, $text, $domain) {
        if ($domain == 'the-events-calendar') {
            switch ($text) {
                case 'Venue':
                    $translation = 'Location';
    				break;
    			case 'Organizer':
                    $translation = 'Contact';
                    break;
    			case 'Organizers':
                    $translation = 'Contacts';
                    break;
    			case 'organizers':
                    $translation = 'contacts';
                    break;
            }
        }
     
        return $translation;
    }
    add_filter('gettext', 'filter_translations', 10, 3);

    Whatest now, Sir Geoff?

    • This reply was modified 10 years, 2 months ago by Mad Dog.
    #1074067
    Mad Dog
    Participant

    Okay….let’s not worry about the relabeling. I looked and apparently there’s a new way to do it (https://theeventscalendar.com/knowledgebase/relabeling-the-venue-organizer-sections-in-event-meta/) and that works fine. Sheesh! It’s the third version of doing that I’ve used!

    So that’s cleared up but it obviously didn’t help the reason I opened this ticket. Any leads for what could be causing the “United States” to be picked up instead of “Select Country” since we know it’s theme related? It definitely didn’t do this before so I do suspect some change in the newest version?

    Thanks,
    MD

    #1074504
    Geoff
    Member

    Thanks for testing that out, MD!

    Well, The Events Calendar does use a Javascript library for dropdowns that is pretty commonly used by other developers, so I wonder if the theme includes a function of perhaps something in its Javascript that is affecting the plugin’s use of it as well.

    Would you be able to reach out to the theme developer to see if they can shed some light on it? Let them know that the issue does not crop up in a default WordPress install and that we’re trying to figure out what might be included in the theme that would have an impact there.

    I’ll leave this thread open in the meantime so I can help answer any questions on this end.

    Thanks!
    Geoff

    #1074689
    Mad Dog
    Participant

    Here’s some more information from testing and checking:

    – When I use WebDev to Inspect the page there are no js conflicts being reported.

    – The theme is actually very simple (Wellness from Themeforest.net). I changed the name of the /js directory and did the same with other js files (there aren’t many). Styling funked out but functionality didn’t change. It still defaults to “United States.”

    – I went to the theme’s default original functions.php file, eliminating all my customizations. It still defaults to United States.”

    – I sent a support question to the theme’s developer and will let you know what he says, though since reverting to the default fucntions.php and blocking all js scripts I can find didn’t change it, so I’m not optimistic he’ll have much input….though you never know.

    I still suspect it’s connected to the upgrade of TEC. This wasn’t a problem before V4 (or one of the later maintenance updates). I know this because I added some CSS to move the “State/Province” button left to align better. Originally you didn’t see the State button, but if you selected US or Canada and the State/Province button showed up it was aligning badly. Now here’s something interesting…….

    So….checking it now, and realizing that there’s CSS which moves the State button left, see if this helps:

    – When the page loads the dropdown defaults to United States. The State button is out of alignment

    – If I select another country, then select United States again, the State button is where it should be!

    That means the CSS #StateProvinceSelect_chosen {padding-left: 350px !important;}) isn’t taking effect when the page loads, but if you change to another country, THEN choose United States, that CSS is working.

    What do you make of all that? Aside from needing some ibuprofin right about now……..

    Thanks,
    MD

    #1074700
    Mad Dog
    Participant

    Apparently the file modules/venue.php was changed in V4…….

    If I delete the old lines:

    if ( $abbr == '' ) {
       echo "disabled='disabled' ";
    }

    it works fine. Looking at the file a lot changed. Grrrrrr…a definite problem with modifying files.

    I need to compare the to files and see if I changed anything earlier or just copied it over in case I needed to and make the changes.

    Case (hopefully) closed.

    Thanks for sticking with me.

    MD

    #1074763
    Mad Dog
    Participant

    Geoff–

    That did it. I had done some small customization (adding “required field” by some fields) so comparing the two versions in Notepad++ made it simple. The new version of the file is much different, including some function names that have changed.

    I feel kind of dumb not thinking of that but hey….

    One thing you might pass along. I know it’s probably a lot of work but it would be really nice for people like me who do a lot of customzation at times to have access to a really good Changelog that tells just what files have been changed (I could scan it and see if any look like files I’ve customized) and more details about function name changes and such, especially if it could affect deprecated ones.

    Anyway, THANKS AGAIN for pushing me through this.

    Mad Dog

    #1077315
    Geoff
    Member

    Nice work, dude! That’s a heck of a lot of effort you put into it and I’m so glad it yielded results.

    We do provide changelog updates with each release as we know how important those are for developers like yourself–in fact, here are the changes we pushed last night. While specific templates and files are often not identified, the impacts of those changes are noted. However, in the case of updating to 4.0, we made a significant number of changes across the board and did indeed detail all the breaking changes.

    Thanks a ton for following up and letting me know what the fix was — let us know if any other questions pop up. 🙂

    Cheers!
    Geoff

Viewing 11 posts - 1 through 11 (of 11 total)
  • The topic ‘Country select default won’t show "Select Country"’ is closed to new replies.