Home › Forums › Calendar Products › Events Calendar PRO › Venue Custom Field Data is Duplicated
- This topic has 8 replies, 2 voices, and was last updated 12 years, 1 month ago by
Barry.
-
AuthorPosts
-
March 4, 2014 at 11:47 am #112396
inhouse
ParticipantHello, we are using My Content Management to create some custom fields for Venues. For some reason, the data is duplicated only when used for Venues. Is this due to the way that Venues are tied into the Events custom post type? I’ve spoken with the My Content Management author and we’ve confirmed this is only happening for Venues, not for Events. He thinks it may be due to the way the venue meta data is saved. He may be able to change something on his end if you can give some info on how the venue meta data is saved.
To be clear, I add a custom field entry and after saving, the data is duplicated. If I try to delete 1 entry, both are deleted. Adding a 2nd entry brings the exact same result. Is this some kind of bug or is a limitation of the plugin? Thanks in advance for any help
March 5, 2014 at 10:28 am #113425Barry
MemberI’m not sure if you mean the custom field values are being duplicated – or the custom fields themselves … can you confirm?
March 5, 2014 at 10:31 am #113427inhouse
ParticipantThanks for your reply. The custom field values are being duplicated. The screenshot should illustrate that. http://imagebin.org/297225
I can grant someone from Tribe access to the the build site in a private message if that would help.
March 5, 2014 at 11:42 am #113474inhouse
ParticipantFor further clarification, the field data that is output shows that each field entry is duplicated.
<ul> <li>Entry 1</li> <li>Entry 1</li> <li>Entry 2</li> <li>Entry 2</li> </ul>And here’s the template below. We’re getting the custom field data for venue ID 83 and displaying it in the header.
$get_smith_hours = mcm_get_custom_field( '_hour-grouping', 83, false, 'array' ); foreach ( $get_smith_hours as $get_smith_hour ) { $parts = explode( ': ', $get_smith_hour ); echo "<li class='header-contact-item'><span class='days'>" . $parts[0]. ":</span> <span class='hours'>". $parts[1]."</span></li>"; }March 6, 2014 at 8:37 am #115792Barry
MemberThanks for clarifying.
While we’d definitely be open to exploring any changes that might be necessary (if there is some indicator of a bug that you/the author of the other plugin can point to) at this time I’m not sure we can provide a lot of further assistance as this is a problem that A) only crops up with this specific plugin you have mentioned, so far as I understand the situation, and B) doesn’t occur if WordPress’s own custom field support is added to venues.
If any information along those lines does come to light though please do let us know 🙂
Thanks!
March 6, 2014 at 8:59 am #115802inhouse
ParticipantHi Barry, for our own sanity and in case others come across this issue or a similar issue, would you mind sharing how the data is stored? This might help the My Content Management plugin author figure out a workaround or possibly even a solution to the problem. The Venues seem to be different than Events in the way the data is stored or there wouldn’t be any issues entering/getting custom field data. Thanks again and we appreciate your help.
Also, I didn’t realize we could add custom field support to Venues but since the plugin custom fields don’t support repeater functionality, they won’t work for what we’re requiring. The Venues need to post hours so we needed to provide repeater fields for this so they could post as many lines as they want and we can display the data any way we need.
March 6, 2014 at 10:54 am #115851Barry
MemberVenues are custom post types like any other – and custom fields (if we’re talking about the regular WordPress variety) are stored in the post meta table, just as they are for posts generally. I can’t really speak for how the My Content Management plugin operates or stores data, though.
If I was to hazard a guess this could be something to do with the set of operations that take place when venues are saved (ie during the save_post action) … but I’d really need to look at My Content Management and see it in action to view the whole chain of events. Realistically, given this isn’t a general problem (and is the first time I’ve seen a reference to the My Content Management) we’re not going to be able to go that extra step on this occasion, I’m afraid.
That said, as before, we will definitely be open to any more specific feedback if there does look to be a problem on our side.
March 13, 2014 at 10:04 am #118308inhouse
ParticipantHi Barry, the My Content Manager author has done some digging and I will place his findings below. It does appear that the way The Events Calendar is saving Venue data is causing duplicate information in the post and then also in the markup. I’m hoping this would be an easy fix for you guys as this website is nearing completion and the duplicate data will be off putting and confusing to the clients who edit the content. Thanks again for your help with this.
What it’s doing is calling an action on save_post to save venue data, which calls a class method called “updateVenue”. That method calls the function wp_update_post, which calls save_post. As a result, save_post gets called twice. They’ve employed some trickery to prevent their own function from triggering an infinite loop, but it doesn’t prevent other posts that are saving meta from being called twice.
March 14, 2014 at 12:41 am #118607Barry
MemberOK, thanks for reporting back (and thanks to the author of My Content Manager!): what I’d recommend in that case is waiting out on our next release, as the area of code in question has in fact been revised and it’s probable this will be resolved once it arrives and is deployed to your site. Though I can’t give an exact timeline for the next release we’re certainly getting close.
Thanks for your patience!
-
AuthorPosts
- The topic ‘Venue Custom Field Data is Duplicated’ is closed to new replies.
