Home › Forums › Calendar Products › Community Events › Issue with Required Fields.
- This topic has 2 replies, 2 voices, and was last updated 11 years, 3 months ago by
Josh.
-
AuthorPosts
-
November 7, 2014 at 5:36 pm #867890
Rick D'Haene
ParticipantHello,
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;
}November 10, 2014 at 4:50 am #873391Josh
ParticipantHello 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!
January 8, 2015 at 5:21 am #930379Josh
ParticipantHey,
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!
-
AuthorPosts
- The topic ‘Issue with Required Fields.’ is closed to new replies.
