Adding Community Events Venue Required Field/s Not Working

Home Forums Calendar Products Community Events Adding Community Events Venue Required Field/s Not Working

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1255683
    Murray
    Participant

    Hello,

    I have a problem trying to get Venue to be a required field when adding a Community Event.

    I have tried the suggestions here (https://theeventscalendar.com/support/forums/topic/required-event-organizer-and-venue-filter-examples-do-not-seem-to-work/) and here (https://theeventscalendar.com/knowledgebase/required-fields-for-events-submission-form/) without success.

    I have also tried turning off all plugins, except relevant Events Calendar plugins, and tested with the Twenty Fourteen and Twenty Seventeen themes.

    Even though venue is set to required a Community Event can be submitted without entering a venue.

    Here is the basic code I added to functions.php:

    add_filter( 'tribe_events_community_required_fields', 'my_community_required_fields', 10, 1 );
     
    function my_community_required_fields( $fields ) {
     
        if ( ! is_array( $fields ) ) {
            return $fields;
        }
    
     	$fields[] = 'venue';
    	$fields[] = 'organizer';
    
        return $fields;
    }

    When adding the following code to functions.php the event will not submit even when a value is entered for Phone:

    add_filter( 'tribe_events_community_required_fields', 'my_venue_community_required_fields', 10, 1 );
    
    function my_venue_community_required_fields( $fields ) {
        
        if ( ! is_array( $fields ) ) {
            return $fields;
        }
    
        $fields[] = 'Phone';
    
        return $fields;
    }

    Note: I have tried both of the snippets recommended in the two urls mentioned above:

    add_filter( 'tribe_events_community_required_venue_fields', 'my_venue_community_required_fields', 10, 1 );
    function my_venue_community_required_fields( $fields ) {
    
    and
    
    add_filter( 'tribe_events_community_required_fields', 'my_venue_community_required_fields', 10, 1 );
    function my_venue_community_required_fields( $fields ) {

    Assistance with this problem would be appreciated.

    Thank-you

    #1256233
    Hunter
    Moderator

    Hey Murray πŸ™‚

    Thank you for your purchase and welcome to the support forums. Lets see if I can help you out here. I attempted to set the Phone and URL venue fields’ as required using the code from our Required Fields for Events Submission Form tutorial, but the event was submitted with no problems which obviously is not what we want here.

    There happened to be a discussion on this topic earlier today involving a few support team members, but I don’t see any solution in the channel we use to communicate. I’ve contacted those involved in hopes of learning more. Once I hear back I’d be happy to update you.

    If you don’t get a response from me within 24-48 hours (slower due to the weekend), feel free to ping me and I’ll see what the situation looks like. Thanks again and have a pleasant rest of your weekend. Cheers!

    #1264490
    Barry
    Member

    Hi Murray,

    Apologies for the delay in getting back to you: this does seem to be a bug and I’ve logged it for further attention. In the meantime, you should be able to workaround this by using the following code:

    https://gist.github.com/barryhughes/f17acb877500e4b777ac8c701baff16f

    This could be included via a custom plugin or by adding the code to your theme or child theme’s function.php file if that’s an approach you are happy with.

    We’ll aim to update this topic as soon as a substantive fix is released (at which point you can remove the above workaround).

    I hope that helps!

    #1300144
    Victor
    Keymaster

    Hi There! πŸ™‚

    I just wanted to let you know we think this issue is no longer a concern with our latest feature release of Community Events 4.5. We encourage you to update to the latest version and try it out.

    To find out more about the release -> https://theeventscalendar.com/release-community-events-4-5-the-events-calendar-4-5-4-pro-and-community-tickets/

    We hope this update makes your site much better!

    As always, don’t hesitate to open a new topic if anything comes up and we’d be happy to help! πŸ™‚

    Best!
    Victor

    #1319590
    Support Droid
    Keymaster

    Hey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.

    Thanks so much!
    The Events Calendar Support Team

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Adding Community Events Venue Required Field/s Not Working’ is closed to new replies.