Help Desk

required fileds submit form

  • Posts: 41 Topics: 15
    | Permalink

    Hihi,

    I’m trying right now to customize my community events submit form. I want some more required fields. For that, I already found your knowledgebase post:
    https://theeventscalendar.com/knowledgebase/required-fields-for-events-submission-form/#venue-fields

    According to that, I add this to my code:

    add_filter( ‘tribe_events_community_required_venue_fields’, ‘my_venue_community_required_fields’, 10, 1 );

    function my_venue_community_required_fields( $fields ) {

    if ( ! is_array( $fields ) ) {
    return $fields;
    }

    $fields[] = ‘Venue’;

    return $fields;
    }

    But sadly the required is still missing. What did I do wrong?

    Posts: 41 Topics: 15
    | Permalink

    I got the same issue with my ‘tax_input’ field with the following code:

        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[] = 'tax_input';
    
        return $fields;
        }
    Posts: 3271 Topics: 4
    | Permalink

    Hi There!

    Thanks for taking your time and reporting this!

    Unfortunately, we are aware of this issue and the team is already working to fix it.

    I will change this thread to “Pending fix” and link it to the bug report so we’ll let you know as soon as a bugfix is released in one of our next maintenance releases.

    I apologise for this inconvenience and we’d appreciate your patience in the meantime.

    Thanks,
    Victor

    Posts: 41 Topics: 15
    | Permalink

    Hi Victor,

    thanks for the info. 🙂
    I will wait for the fix.

    Greetings
    Patrick

    Posts: 3271 Topics: 4
    | Permalink

    Thanks Patrick! We’ll keep you posted. 🙂

     

    Posts: 7 Topics: 6
    | Permalink

    Really need this fixed! We bought CE specifically to allow frontend event creation and not having the ability to require fields is a major issue!

    Posts: 3271 Topics: 4
    | Permalink

    Hey @jgroll, thanks for chiming in!

    I’ve just reviewed the report on this issue and it seems a fix has been submitted and has already passed QA successfully. It still has to go through its final steps, but there is a good chance this will be available in our next maintenance release this week.

    My apologies for the inconvenience.

    Best,
    Victor

     

    Posts: 6325 Topics: 6
    | Permalink

    Hey,

    Just wanted to share with you that a new maintenance release (for the Week of 26th June 2017) is out, including a fix for this issue 🙂

    You should be able to use the snippet described in this article to make venue/organizers required.

    Find out more about this release → https://theeventscalendar.com/maintenance-release-week-26th-june-2017/

    Please update the plugins and let us know if the fix works for your site,
    Best,
    Nico

    Posts: 41 Topics: 15
    | Permalink

    Hi Nico,

    thanks for the update.
    I just installed the updates, but sadly the problem remains for me 🙁

    Greetings
    Patrick

    Posts: 3271 Topics: 4
    | Permalink

    Hello Patrick!

    Thanks for following up on this.

    I’ve just checked it myself and it doesn’t work for me either requiring venue. It does work for organizer. I will make sure to bring this up to the team so they can double check and see what went wrong.

    Could you please confirm it does not work for venue, but it does with organizer?

    My apologies once again. We will keep you posted about it.

    Thanks for taking your time and reporting this.

    Have a nice weekend!
    Victor

    Posts: 41 Topics: 15
    | Permalink

    Hi Victor,

    I’ve tried it. The field “organizer” gets the “(requierd)” präfix, but when I hit the submit-button, I get the message that the form only needs “title” and “description”, not organizer or in my case “venue” and “taxonomy”

    Greetings
    Patrick

    Posts: 3271 Topics: 4
    | Permalink

    Hello Patrick!

    Thanks for following up on this!

    We’d really appreciate if you could try the following code snippet and let us know if it works for event category, venue and organizer.

    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[] = 'tribe_events_cat';
    $fields[] = 'venue';
    $fields[] = 'organizer';
    
    return $fields;
    }
    

    Also, could you please share with us your sys info by following this guide > https://theeventscalendar.com/knowledgebase/sharing-sys-info/

    Thanks!
    Victor

    Posts: 41 Topics: 15
    | Permalink
    This reply has been marked as private.
    Posts: 3271 Topics: 4
    | Permalink
    This reply has been marked as private.
    Posts: 41 Topics: 15
    | Permalink
    This reply has been marked as private.
    Posts: 3271 Topics: 4
    | Permalink
    This reply has been marked as private.
    Posts: 3271 Topics: 4
    | Permalink

    Hello Patrick!

    Just wanted to share with you that a new maintenance release (for the Week of 24 July 2017) is out, including a fix for this issue 🙂

    Find out more about this release → https://theeventscalendar.com/maintenance-release-week-24-july-2017/

    Please update the plugins and let us know if the fix works for your site.

    Best,
    Victor

    Posts: 41 Topics: 15
    | Permalink

    Hi Victor,

    thanks for letting me know. 🙂
    I just installed the updates.
    Sadly there are no changes at all.

    Greetigns
    Patrick

    Posts: 3271 Topics: 4
    | Permalink

    Hello Patrick!

    Thanks for following up with this.

    I’m really sorry this isn’t working for you.

    I know you wanted to require the organizer, is it not working for organizer or other fields too?

    Could you please try the following code snippet and see if it works for requiring venue and organizer? I could make it work with this:

    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;
    }

    Please let me know about it.

    Thanks,
    Victor

    Posts: 41 Topics: 15
    | Permalink

    Hi Victor,

    for testing purpose I’ve added all possible requiered fields

    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[] = 'post_content';
    $fields[] = 'event_image';
    $fields[] = 'EventStartDate';
    $fields[] = 'EventStartHour';
    $fields[] = 'EventStartMinute';
    $fields[] = 'EventStartMeridian';
    $fields[] = 'EventEndDate';
    $fields[] = 'EventEndMinute';
    $fields[] = 'EventEndHour';
    $fields[] = 'EventEndMeridian';
    $fields[] = 'is_recurring';
    $fields[] = 'EventCurrencySymbol';
    $fields[] = 'tax_input (for event categories)';
    $fields[] = 'venue';
    $fields[] = 'organizer';
    $fields[] = 'EventShowMapLink';
    $fields[] = 'EventURL';
    
    return $fields;
    }
    
    add_filter( 'tribe_events_community_required_venue_fields', 'my_venue_community_required_fields', 10, 1 );
    
    function my_venue_community_required_fields( $fields ) {
        
        if ( ! is_array( $fields ) ) {
            return $fields;
        }
    
    $fields[] = 'Venue';
    $fields[] = 'Address';
    $fields[] = 'City';
    $fields[] = 'Province';
    $fields[] = 'State';
    $fields[] = 'Zip';
    $fields[] = 'Phone';
    $fields[] = 'URL';
    
        return $fields;
    }
    
    add_filter( 'tribe_events_community_required_organizer_fields', 'my_organizer_community_required_fields', 10, 1 );
    
    function my_organizer_community_required_fields( $fields ) {
        
        if ( ! is_array( $fields ) ) {
            return $fields;
        }
    
    $fields[] = 'Organizer';
    $fields[] = 'Phone';
    $fields[] = 'Website';
    $fields[] = 'Email';
    
        return $fields;
    }

    None of them is working

    Greetings
    Patrick

    Posts: 3271 Topics: 4
    | Permalink

    Hi Patrick!

    The code you sent is working for me. Are you placing the code in your active theme’s functions.php file?

    Are you using any plugin to do so?

    Let me know about it.

    Best,
    Victor

    Posts: 41 Topics: 15
    | Permalink

    Hi Victor,

    initial I had the code in my theme/trive-events/community/edit-event.php
    But now I moved it into my theme’s function.php.
    And now, some of them are working but the both I need don’t
    Even more, now I can’t search for categories anymore, I get an “loading faild” error. Even if I undo my changes the problem remains. I already installed the newest updates. It also didn’t helped.

    I don’t use any plugin for modifying my function.php. I manually copy & paste the code 😉

    Greetings
    Patrick

    Posts: 41 Topics: 15
    | Permalink

    Ok, I was able to get things back to work. The “loading faild” is gone and ones again I get my categories. I had to reinstall the whole core Plugin.
    Sadly the remaining problems stay 🙁

    Posts: 3271 Topics: 4
    | Permalink

    Hello Patrick!

    Thanks for following up with this and keep me posted about the updates.

    Good to know at least some of the required fields are working now. This means the code is in the right place 🙂

    Now, could you please tell me what required fields aren’t working for you and share the actual code you are using?

    If you could share with me the community add link it would be great so I can see for myself.

    Thanks,
    Victor

    Posts: 41 Topics: 15
    | Permalink

    Hi Victor,

    sorry for my late reply. I didn’t receive an notification email that someone wrote an answer.
    My function.php looks like this:

    <?php
    # 2017-07-25, fries: Funktion für Anzeige der Event-Kategorien hinzugefügt
    # 2017-06-21, fries: Wörter im Kalender-Plugin ändern
    #$custom_text = array(
    #'Related %s' => 'Similar %s',
    #'category' => 'Raum',
    #'taxonomy' => 'Raum',
    #'TAXONOMY' => 'Raum',
    #'Kategorien' => 'Raum',
    #);
    # 2015-06-01, schoch: Schlagworte mit the_tags eingefuegt
    function et_divi_post_meta() {
            $postinfo = is_single() ? et_get_option( 'divi_postinfo2' ) : et_get_option( 'divi_postinfo1' );
    
            if ( $postinfo ) :
                    echo '<p class="post-meta">';
                    et_postinfo_meta( $postinfo, et_get_option( 'divi_date_format', 'M j, Y' ), esc_html__( '0 comments', 'Divi' ), esc_html__( '1 comment', 'Divi' ), '% ' . esc_html__( 'comments', 'Divi' ) );
    				echo ' | ';
    				the_tags();
    				echo '</p>';
            endif;
    }
    
    function remove_google_fonts_from_theme() {
       //get rid of those google fonts
       //remove_action('et_head_meta','et_add_google_fonts');
       //remove_action( 'wp_head', 'et_set_font_properties' );
       remove_action( 'wp_enqueue_scripts', 'et_divi_load_fonts' );
    }
    
      add_action( 'after_setup_theme', 'remove_google_fonts_from_theme' );
    if ( class_exists('Tribe__Events__Main') ){
     
        
       /* get event category names in text format */
        function tribe_get_text_categories ( $event_id = null ) {
     
            if ( is_null( $event_id ) ) {
                $event_id = get_the_ID();
            }
     
            $event_cats = '';
     
            $term_list = wp_get_post_terms( $event_id, Tribe__Events__Main::TAXONOMY );
     
            foreach( $term_list as $term_single ) {
                $event_cats .= $term_single->name . ', ';
            }
     
            return rtrim($event_cats, ', ');
     
        }
     
    }  
     ?>
    
     <?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[] = 'tax_input'; 
    $fields[] = 'venue';
     
    return $fields;
    }
    
    add_filter( 'tribe_events_community_required_venue_fields', 'my_venue_community_required_fields', 10, 1 );
    
    function my_venue_community_required_fields( $fields ) {
        
        if ( ! is_array( $fields ) ) {
            return $fields;
        }
    
        $fields[] = 'Venue';
    
        return $fields;
    }
    ?>

    I can’t get it work that the fields Event-Categories and venues are requiered. I uploaded a screenshot for a better understanding, which fields I mean.
    Sadly I can’t send you a link to the community-link because the website is only internal accessable.

    Greetings
    Patrick

    Posts: 3271 Topics: 4
    | Permalink

    Hi Patrick!

    Thanks for coming back with the code you are using and for the screenshot.

    I could reproduce the issue you are having. Requiring the tax_input does not work as you’d expect.

    I have logged a new report for this so it can be addresses in one the next maintenance releases. We’ll let you know as soon as a bugfix is released for it.

    I apologise for this issue and we’d appreciate your patience while we work on this.

    Best,
    Victor

    Posts: 3545
    | Permalink

    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 🙂

    Posts: 41 Topics: 15
    | Permalink

    Hi Courtney,

    thank’s for the information.
    I just updated our website and gave it a try. Sadly it seems, nothing have chanced 🙁
    I got still the same problem.

    Greetings
    Patrick

    Posts: 3271 Topics: 4
    | Permalink

    Hi Patrick!

    Thanks for following up with this.

    We are still in the process of updating the Knowledgebase articles for this, but here’s the code you should use to make the event category a required field:

    add_filter( 'tribe_events_community_required_fields', 'my_community_required_fields' );
    function my_community_required_fields( $fields ) {
       if ( is_array( $fields ) ) {
          $fields[] = 'tax_input.tribe_events_cat';
       }
       return $fields;
    }

    Please try it out and let me know if it works for you.

    Thanks,
    Victor

    Posts: 41 Topics: 15
    | Permalink

    Hi Victor,

    great thing!! The Event Categories finally work as intended. 🙂
    But sadly I got a problem with the venues.
    The venue-field gets labeld as requiered, but this will not be checked.
    I hope it’s visible in my screenshot.

    Greetings Patrick

The topic ‘required fileds submit form’ is closed to new replies.