Adding "organizer" to required field filter prevents it from being saved
[From the developer I am working with, Carole:]
I followed https://tri.be/change-required-fields-on-community-event-submission-page/ and added a filter to specify additional required fields on the community/add (and edit) page. When I add ‘organizer’ to the array of required fields, changes made to the organizer of an event aren’t saved. As near as I can tell, here’s the basic repro:
1. Add events via the community plugin (I’m signed in as an admin so they’re listed under My Events). Include an organizer (or choose an existing one).
2. Add a filter for tribe_events_community_required_fields that includes ‘organizer’. I also included ‘post_content’ and ‘post_title’
3. Edit an event via the plugin. Change the organizer to another value.
4. Save the event.
5. When taken to My Events page, click the Edit link for the event you just changed.
OBSERVED RESULTS: The organizer is still the original value,
EXPECTED RESULTS: The organizer is changed to the value entered in step 3.
6. Remove the filter in step 2 or just remove ‘organizer’ from the array
7. Repeat steps 3-5
OBSERVED RESULTS: The organizer has been changed to the new value.
After finding https://theeventscalendar.com/support/forums/topic/required-fields-in-community-events/ and https://theeventscalendar.com/support/forums/topic/change-required-fields-on-community-event-submission-page/, I took a closer look at the tutorial. While the tutorial sort of warns about using indexes in fields, it doesn’t warn about using ‘venue’ and ‘organizer’. If no more information can be added about making these fields required, those values should be removed from the list of Possible Field Names to Include, as including them introduces a bug.
But I still contend that the tutorial implies one should add ‘organizer’ in the filter, but doing so results in breaking behavior. And that needs to be addressed.
Thanks for reaching out here. The tutorial does list all possible fields to include, but includes a note about needing further code to successfully validate the organizer and venue fields (screenshot), since those fields are more complex. As stated at the of top of this tutorial (screenshot), it’s just designed to serve as a starting place and not be a complete solution.
Hopefully that helps to answer your questions, but let me know if I can clarify further. Thanks! 🙂