Home › Forums › Calendar Products › Community Events › Community Event Edit form does not maintain category info
- This topic has 8 replies, 5 voices, and was last updated 9 years, 7 months ago by
Lisa.
-
AuthorPosts
-
August 2, 2016 at 12:30 pm #1146759
Lisa
ParticipantThe process that builds the community edit form ( /events/community/edit/event/{ID}/ ) doesn’t pass the currently selected term id’s to the wp_terms_checklist function.
Looking at the comments for
the_category_checklist(), $currently_selected is deprecated and theoretically passed from the $_POST variable. $_POST was empty in the tests I ran.August 2, 2016 at 7:02 pm #1146890Brook
ParticipantHowdy Lisa,
I would love to help you with this.
From what I gather you are just trying to generate the term list, using wp_terms_checklist(), for the post on the ( /events/community/edit/event/{ID}/ ) page.
This should be easy enough to do. The first argument that wp_terms_checklist() is the post id. So you can just pass it that.
If you are doing this inside of our template file then you can obtain the event ID from either of these variables:
$event->ID $tribe_event_id
If you are outside of the template look you can still obtain the event ID doing this:
global $wp; $event_id = $wp->query_vars[ 'tribe_community_event_id' ];
Now that you have the event ID just pass it to
wp_terms_checklist( $event_id, $args );
Obviously you will still need to setup $args. But you should be able to generate that checklist now anywhere on the page. Does that do what you wanted?
Cheers!
– Brook
August 3, 2016 at 3:14 am #1146956Lisa
ParticipantThanks for the reply Brook.
I’m using the Community Events plugin. When a user goes to edit one of their events using the community event edit event form, the previously selected categories are not checked. I believe that when editing an event any categories already associated with the event would be checked as part of the form creation process.
The generation of the category section is done by the template the-events-calendar-community-events/src/views/community/modules/taxonomy.php. The template calls Tribe__Events__Community__Modules__Taxonomy_Block::instance()->the_category_checklist( get_post() ); to get the list of categories to display. This function begins at line 72 of the-events-calendar-community-events/src/Tribe/Modules/Taxonomy_Block.php. The $args array is created with a selected_cats element. The way this function is coded the selected_cats element will be an empty array.
August 3, 2016 at 3:47 pm #1147392Brook
ParticipantThank you for clarifying Lisa! I now get the problem. Yes that is a bug and one we’re working to fix. I am hoping that it will get patched in version 4.2.5 of our plugin, which is due for release in 2 weeks time. But we have not finished scoping that release yet and so I can not say for sure if it will stay in there. Either way I have added your topic to the list of those affected and bumped the priority of that ticket. This means that we will respond to you when a release is ready with a fix, so that you can then hit update and watch the problem disappear. 🙂
I wish I had better news on that front. Right now the only option for fixing this is to downgrade to a past version of the plugin that this worked in (Downgrading a plugin).
Does that all make sense and answer your questions?
Cheers!
– Brook
August 4, 2016 at 4:39 am #1147500Lisa
ParticipantThanks for the update Brook.
I have a fix in place until the update is pushed.
August 9, 2016 at 10:38 am #1149588Brook
ParticipantGood to hear! This ticket is now one step closer to being in 4.2.5. It looks pretty likely it will get fixed in the next release. 🙂
– Brook
August 26, 2016 at 4:36 pm #1156580Nico
MemberHi there,
Just wanted to give you a heads up that the maintenance release that went out recently has a fix for this issue. Please update when you have a chance and please do let us know if you continue to see this or any other issue happen — we’d be happy to help.
Thanks, hope you have a great weekend,
NicoSeptember 17, 2016 at 9:35 am #1165524Support Droid
KeymasterHey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.
Thanks so much!
The Events Calendar Support Team -
AuthorPosts
- The topic ‘Community Event Edit form does not maintain category info’ is closed to new replies.
