Home › Forums › Calendar Products › Community Events › Adding "organizer" to required field filter prevents it from being saved
- This topic has 4 replies, 2 voices, and was last updated 9 years, 10 months ago by Casey.
-
AuthorPosts
-
May 26, 2014 at 8:37 pm #179414pickleshyParticipant
[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.
Ideally, the tutorial would show, or at least hint, at what’s needed to make organizer and venue required. Can I return an array of an array, ie., return array(‘organizer’, array(‘Organizer’)) to require the Organizer[Organizer] field? Upon closer inspection, I see that I’d still have to account for the id being selected or all the fields having values. At that point, it seems that JavaScript is probably better than using the filter. OK, yeah I get why the tutorial stops short of that.
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.
May 28, 2014 at 6:40 am #183770CaseyParticipantpickleshy,
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! ๐
-Casey-
June 24, 2014 at 12:00 pm #247801CaseyParticipantI just wanted to follow up and see if youโre all set here or if you still have further questions. Just let me know if you have further questions or if I should go ahead and close out this thread. Thanks! ๐
-Casey-
June 25, 2014 at 9:17 am #250336pickleshyParticipantYes, we’re all good. Thanks!
June 25, 2014 at 12:10 pm #250742CaseyParticipantGreat! Thanks for confirming that this got you sorted. Since it looks like you’re all set, I’m going to mark this thread “Answered” and close it out.
Feel free to create a new thread if you have further issues.
Thanks!
Cheers,
Casey -
AuthorPosts
- The topic ‘Adding "organizer" to required field filter prevents it from being saved’ is closed to new replies.