Issue with Required Fields.

Home Forums Calendar Products Community Events Issue with Required Fields.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #867890
    Rick D'Haene
    Participant

    Hello,
    I’ve followed this: https://theeventscalendar.com/change-required-fields-on-community-event-submission-page/ in order to require specific fields on the submission page. Specifically, the Organizer Email field.
    The issue that I’m seeing is that when a notification comes in and I click the Review Event link I’m taken to the front-end submission details page. When I click the submit button on that page, I get a warning stating that the organizer’s email is required. Looking down at the organizer section I see that it is using a previously saved organizer. After looking into that specific organizer’s information I see that an email address exists for that user.

    Why am I getting this error even though the organizer’s email exists?

    Here is what I have added to my functions.php file:
    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’,
    ‘EventCurrencySymbol’,
    ‘EventURL’,
    ‘EventStartDate’,
    ‘venue’,
    ‘organizer’
    );

    // 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”).
    //
    // You could take this a step further and additionally validate the
    // email field to ensure it looks like a valid email address and
    // provide an alternative error using the same approach.
    if ( empty( $_POST[‘organizer’][‘Email’] ) )
    $fields[] = ‘Organizer Email’;

    return $fields;
    }

    #873391
    Josh
    Participant

    Hello Rick,

    Thanks for reaching out to us!

    Unfortunately, I wasn’t able to recreate the issue on my local install using the information provided above. However, I do have an idea that may be able to help. If you would like to only require the Organizer Email field, try removing “organizer” from your $fields array section. This requires the entire section rather than just the individual field.

    Let me know if this helps.

    Thanks!

    #930379
    Josh
    Participant

    Hey,

    We like to close out tickets after they’ve been inactive for a couple of weeks. If you have any further questions on this issue, please don’t hesitate to open a new ticket.

    Thanks!

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Issue with Required Fields.’ is closed to new replies.