Forum Replies Created
-
AuthorPosts
-
Sean
ParticipantHi Brook,
Ah, okay. Yes, with more complicated recurrence patterns I can see how the description would not be able to be as simple. Hopefully for the cases in which there are no “rules” the previous descriptions could still be used. Look forward to a fix whenever it is ready!
Best,
KarlySean
ParticipantGood afternoon George,
Thanks for your reply. I my latter snippet again before trying yours (since they both look identical other than the class), and it worked! Not sure why it wasn’t working previously. Perhaps I had been staring at code too long that day and made a typo similar to the KB article 🙂 In any case, this is all set now.
Best,
KarlySean
ParticipantOkay sounds good Nico. Thank you for the advice!
Sean
ParticipantMight as well report a few other issues I discovered when further testing the Submit an Event form. These all occur when the required fields error message is returned after the user does not initially enter all required fields.
1. All recurrence rules entered are reset (rule changes back to “once” and user must re-enter all rules).
2. Data entered into any of the Organizer fields (Organizer Name, Organizer Email, etc) is erased.
3. For Additional Fields that are checkbox options, any selected options are erased upon the page refreshing and the required fields error messages being shown.
4. When editing an recurring event via the Community Events form, the message “Warning: You are editing a recurring event. All changes will be applied to the entire series.” is displayed at the top of the form. However, this leads to the custom error message that is set for the form to also be displayed. I assume this last item can be fixed by adding an additional conditional statement in the functions.php file to not return the custom error message when the page is initially displayed when the user starts to “edit” the recurring event?Sean
ParticipantAlso, when selecting an option for the Additional Field “Event Type” the following error is returned in the Additional fields meta box:
Warning: stripslashes() expects parameter 1 to be string, array given in /wp-content/plugins/the-events-calendar-community-events/src/Tribe/Event_Form.php on line 204
Obviously with that being a core file, it is unchanged on our end. Why would this be occurring and how can it be resolved?
Thank you,
KarlySean
ParticipantThanks for pointing me in the right direction Nico. I was able to hide the Country field by changing what I was targeting.
On a related note, I’ve noticed discrepancies on where we should put custom styles for our calendar. Should we put them in our theme’s CSS file, or in tribe-events/tribe-events.css and tribe-events/pro/tribe-events-pro.css?
Sean
ParticipantBrian,
Thanks for looking at the code and glad to hear there shouldn’t be any issues with 4.0 compatibility.
I think this is all set for now.
Best,
KarlySean
ParticipantHi Brian,
I did not see any mention of how to replace an error message in the guide. Regarding the code in the guide, the section for the organizers did not work, but I was already able to get that resolved.
I was able to find an old post which seems to have addressed my two questions here (changing a specific error message and including a custom message before the individual errors). Would you be able to give this a quick glance to ensure it doesn’t include any code that is deprecated or otherwise might conflict with version 4.0?
// Customize Required Fields Error Message function ce_custom_error_msg( $errors ) { // Don't filter if it is an 'update' or other type of message if ( $errors[0]['type'] != 'error' ) return $errors; $existing_errors = ''; $type = 'error'; if ( is_array( $errors ) ) { $existing_errors = $errors[0]['message']; $type = $errors[0]['type']; } // Set overall message by appending a heading to the front $errors[0] = array( 'type' => $type, 'message' => '<h5>There was a problem submitting your event. The following fields are required:</h5>' . $existing_errors ); // User str_replace to choose a specific message to change $errors[0]['message'] = str_replace( 'Tax Input is required', 'Event Category is required', $errors[0]['message'] ); $errors[0]['message'] = str_replace( 'Organizer is required', 'Organizer Name is required', $errors[0]['message'] ); $errors[0]['message'] = str_replace( 'Venue is required', 'Venue Name is required', $errors[0]['message'] ); return $errors; } // Return custom error message add_filter( 'tribe_community_events_form_errors', 'ce_redirect_after_submit', 10, 1 ); function ce_redirect_after_submit( $messages ) { if ( is_array( $messages ) && !empty( $messages ) ) { $messages = ce_custom_error_msg( $messages ); $first_message = reset( $messages ); if ( $first_message['type'] == 'update' ) { add_action( 'parse_request', 'tribe_redirect_after_community_submission', 11, 1 ); } } return $messages; }Thank you,
KarlySean
ParticipantHi Geoff,
Thank you for your quick response. Disappointed to hear there likely won’t be an Alpha copy available, but yes, I have signed up to be a beta tester. Do you guys still expect to release that in late October/early November (e.g. in the next week or so?). If you can’t tell, we’re more than eager to try it out and help with QA! 🙂
Karly
Sean
ParticipantHi Josh,
Sorry, yes earlier today I was able to figure out how to hide the Google Map/Link sections of the Submit an Event form via CSS and I forgot to update this ticket. Thanks for following up! I’ll mark this as resolved.
Best,
KarlySean
ParticipantHi Josh,
Thank you very much, that worked perfectly!
On a related note, to hide the “Show Google Maps Link” and “Show Google Map” labels and checkboxes, would CSS work best there as well (what class should we look for?) or should we try doing a template override to venue.php?
Best,
KarlyOctober 28, 2015 at 6:58 am in reply to: Setting Venue and Organizer sub-fields as required #1019256Sean
ParticipantThank you very much Nico. That works for me too!
October 26, 2015 at 12:43 pm in reply to: Setting Venue and Organizer sub-fields as required #1018646Sean
ParticipantHi Nico,
Thank you for bringing that topic to my attention. I tried Brian’s code but am receiving the following error:
Warning: Invalid argument supplied for foreach() in …/functions.php on line 58
I’ve copied Brian’s code for that filter exactly, so I’m not sure why that error is appearing:
add_filter( 'tribe_events_community_required_fields', 'tribe_community_required_fields_org_email', 10, 1 ); function tribe_community_required_fields_org_email( $fields ) { $required_email = $_POST['organizer']['Email']; foreach( $required_email as $email) { if ( empty( $email ) ) $fields[] = 'Organizer Email'; } return $fields; }Please advise.
Sean
ParticipantBrook, just had one question I’m hoping you can answer in the meantime. Have any changes or additions been made to the CSV Import tool? We are customizing that to enable each event to be associated with its proper author (as opposed to all imported events being associated with the account that performs the import). Just wanted to know if we could start that development now or if we should review the Alpha version of 4.0 if that functionality has been modified. Thank you.
-
AuthorPosts
