Venue name and City are required after update….when they're in the Saved Venue

Home Forums Calendar Products Community Events Venue name and City are required after update….when they're in the Saved Venue

Viewing 15 posts - 1 through 15 (of 28 total)
  • Author
    Posts
  • #1003843
    Mad Dog
    Participant

    Since updating to 3.12 (actually, 3.12.1 now) when a user adds a new event they get a “Venue Name is required. Venue City is required” error. This is using a Saved Venue that definitely has a Name and City. It doesn’t matter which Saved Venue I use, I get the same error.

    http://thaihealingalliance.com/events/courses/add

    #1003854
    Mad Dog
    Participant

    Further testing….I can add an event using a New Venue but get the same errors mentioned above whenever I try to use a Saved Venue.

    #1004044
    George
    Participant

    Hey @Mad Dog,

    Really sorry to hear about these issues! For starters, can you share your system information with us? Here’s how to do so → https://theeventscalendar.com/knowledgebase/sharing-sys-info/

    From there, though this may sound like an odd thing to test, I’m curious: does anything improve if you go to Settings > Permalinks in your admin area, and just click “Save Changes” without actually making any changes? This may seem like an odd thing to do but is a little “trick” within WordPress to get the permalinks across your site to refresh, which might help here.

    Let us know what you find!

    Thanks,
    George

    #1004047
    Mad Dog
    Participant

    This reply is private.

    #1004297
    George
    Participant

    Thank you for the system information! And for looking into this a bit…

    I’m sorry that the Save Permalinks trick didn’t help, as this means that the next best thing to try is to run through a full set of troubleshooting steps to look for code conflicts, which might be rather likely to exist here since you have many plugins (which isn’t a problem! 🙂 just noting that more plugins = more of a chance of conflict).

    We have a whole set of steps outlined here → https://theeventscalendar.com/knowledgebase/testing-for-conflicts/

    I’d recommend running through those steps and seeing what you find if after each plugin deactivation you try to submit a community event. Do the same venue issues persist?

    These steps may seem tedious but are actually pretty quick to work through, especially if you harness the power of multiple browser tabs 😉

    Thank you for your patience here – let us know what you find!

    — George

    #1004462
    Mad Dog
    Participant

    The problem is simple but I’m not sure why it’s not working. To be honest, it might not have worked right before the recent plugin update — I’m not sure if I tested it.

    Anyway, I wanted to make Venue Name and Venue City required fields. Following TEC instructions, I added the code below as part of the function. Oddly, it doesn’t have a problem with the Organizer required fields using a Saved Organizer, but does throw an error for the required Venue fields when using a Saved Venue!

    If I comment out the Venue requirement lines all is good.

    Is there something wrong with my code?

        // Requiring the organizer email (or other "square bracketed" fields) can't be done using the above approach, but we can
        // simply test within the $_POST superglobal directly. If a field hasn't been populated then we simply add a requirement
        // using a field name we know doesn't exist, but can be used to form a meaningful error message (if the org email is
    	// missing the user will see "Organizer Email is required").
        if ( empty( $_POST['venue']['Venue'] ) )
            $fields[] = 'Venue Name';
    	if ( empty( $_POST['venue']['City'] ) )
            $fields[] = 'Venue City';
    	if ( empty( $_POST['organizer']['Organizer'] ) )
            $fields[] = 'Organizer Name';
    	if ( empty( $_POST['organizer']['Email'] ) )
            $fields[] = 'Organizer Email';
     
        return $fields;
    #1004582
    George
    Participant

    Hey @Mad Dog,

    Do you mean that with this code present on your site, the issues you started this thread about are not present? And then only when this custom code is active on your site, you have the problem with the “Venue Name is required. Venue City is required.” error?

    Sorry about my confusion, trust trying to be 100% clear on how everything is related here! 🙂

    If even without this custom code on your site, you still have that error, I’d recommend the steps outlined in my reply before this one to help reveal or rule out a theme or plugin conflict.

    Thank you!
    George

    #1004587
    Mad Dog
    Participant

    George–

    I know it sounds confusing at this point but it’s actually not:

    – If I DON’T have this code included in the function, everything works perfectly and as it should.

    – When I do add this code, I get the “Venue Name is required. Venue City is required.” error when adding a new Events using a Saved Venue.

    – However…with this code added I DON’T have a similar problem with the Organizer fields when using a Saved Organizer. It works fine.

    So the problem is only for Venue when using this code and a Saved Venue (I can add a new venue with the new event fine).

    Hope that’s clear….

    #1005090
    George
    Participant

    Hey @Mad Dog,

    Thanks for both your patience here and for elaborating on how these things are all related on your site. Community submissions are still working okay for me on my test site, so while we’re getting closer to a solution or at least an understanding of the problem here, can I trouble you for one more clarification of something?

    It’s the last one, I promise! 🙂

    What I’m curious about is how you mention this:

    If I DON’T have this code included in the function, everything works perfectly and as it should.

    And then you also mention this:

    – However…with this code added I DON’T have a similar problem with the Organizer fields when using a Saved Organizer. It works fine.

    To clarify: you say the “everything works perfectly” without your custom code, but then seem to imply that, even without the custom code, there is in fact an issue with using a saved organizer. So, in other words, that even with that custom code removed, things don’t actually “work perfectly”…

    I’m really sorry if this seems like just mincing words, but it’s actually a big deal, because so far I have been unable to recreate your problems – problems with the Venue or with Organizer. So if you have problems with one of these on your site even without any custom code, then that indicates a genuine bug at play and I can reach out to other team members for some help investigating this.

    However, if your first quote is accurate and even your “Saved Organizer” issue does not persist when your custom code is removed, then the custom code itself is the source of these problems and we can narrow our search there.

    I’m really sorry about the back-and-forth over these details, @Mad Dog! Thank you for being patient with me. I just want to make sure that I address the problem here at its core.

    Thank you!
    George

    #1005104
    Mad Dog
    Participant

    No problem George. Sorry if it was confusing. Maybe this will clear it up:

    Below is the code I’m adding in its entirety. Obviously only the second part is relevant to this but I’m including it all in case you need it. It’s taken directly from a TEC snippet:

    // EVENTS Required fields for forms
    add_filter( 'tribe_events_community_required_fields', 'my_community_required_fields', 10, 1 );
     
    function my_community_required_fields( $fields ) {
        $fields = array(
            'post_title',
            'post_content',
            'EventCost',
            'EventCurrencySymbol',
            '_ecp_custom_2',
            '_ecp_custom_7',
    		'_ecp_custom_8',
    
        );
     
        // Requiring the organizer email (or other "square bracketed" fields) can't be done using the above approach,
       //but we can simply test within the $_POST superglobal directly. If a field hasn't been populated then we simply 
       //add a requirement using a field name we know doesn't exist, but can be used to form a meaningful error message 
       //(if the org email is missing the user will see "Organizer Email is required").
        if ( empty( $_POST['venue']['Venue'] ) )
            $fields[] = 'Venue Name';
        if ( empty( $_POST['venue']['City'] ) )
            $fields[] = 'Venue City';
        if ( empty( $_POST['organizer']['Organizer'] ) )
            $fields[] = 'Organizer Name';
        if ( empty( $_POST['organizer']['Email'] ) )
            $fields[] = 'Organizer Email';
     
        return $fields;
    }
    

    When I use this code I get the “Venue required” errors when using a SAVED VENUE. Using a SAVED ORGANIZER doesn’t throw an error message.

    – If I comment out the Venue lines like below I can Add an Event with a SAVED VENUE without throwing a validation error. (Organizer is never a problem…that’s what I think I confused you with. This is only a problem with Saved Venue when I make those two Venue fields required.)

    //if ( empty( $_POST['venue']['Venue'] ) )
        //    $fields[] = 'Venue Name';
    	//if ( empty( $_POST['venue']['City'] ) )
        //    $fields[] = 'Venue City';
    	if ( empty( $_POST['organizer']['Organizer'] ) )
            $fields[] = 'Organizer Name';
    	if ( empty( $_POST['organizer']['Email'] ) )
            $fields[] = 'Organizer Email';
    

    Is there something wrong with my code for the Venue name and city??

    • This reply was modified 10 years, 7 months ago by Mad Dog. Reason: clarity
    • This reply was modified 10 years, 7 months ago by Mad Dog.
    #1005602
    Mad Dog
    Participant

    No thoughts on this one? Are you able to replicate the problem?

    #1005786
    George
    Participant

    Hey Mad Dog,

    I’m sorry for the delayed reply, it’s just that no, I do not recreate your problem 🙁 I’m also a bit confused still, based on your notes here:

    Organizer is never a problem…that’s what I think I confused you with. This is only a problem with Saved Venue when I make those two Venue fields required.

    It seems to me like simply not making those two venue fields required would solve your problems, is that right? Do you agree? If not, why not? I’m very, very sorry about how this thread has dragged on – your patience and your willingness to clarify things for me is much appreciated. I am just not able to to produce errors like you encounter, and so troubleshooting has been challenging – thank you for sticking with me despite that! 🙂

    Sincerely,
    George

    #1005815
    Mad Dog
    Participant

    You’re right, not making those fields definitely makes things work right. We were just trying to make it so if you enter a New Venue from the Add an Event page you HAVE to enter Venue Name and City, otherwise an admin will have to follow up.

    The problem is, simply put: If I use the above code to make Venue Name and Venue City required, when I use a Saved Venue the page throws a validation error saying those fields are required.

    MD

    #1005827
    Mad Dog
    Participant

    Ahem…”…not making those fields REQUIRED definitely makes things work right…”

    Sorry about the omission.

    #1006070
    George
    Participant

    Hey @Mad Dog,

    Thanks so much for helping clarify things for me. If possible, I’m wondering if you’d be willing to try replacing your code with this code instead:

    add_filter( 'tribe_events_community_required_fields', 'my_community_required_fields', 10, 1 );

    function my_community_required_fields( $fields ) {
    $fields[] = 'EventCost';
    $fields[] = 'EventCurrencySymbol';
    $fields[] = '_ecp_custom_2';
    $fields[] = '_ecp_custom_7';
    $fields[] = '_ecp_custom_8';
    $fields[] = 'venuue';
    $fields[] = 'organizer';

    return $fields;
    }

    I wrote that up for you and just tested it on my site and it works well – organizers and venue information is required to submit.

    Does this help at all? Let me know! 🙂

Viewing 15 posts - 1 through 15 (of 28 total)
  • The topic ‘Venue name and City are required after update….when they're in the Saved Venue’ is closed to new replies.