Home › Forums › Calendar Products › Events Calendar PRO › Venue Location Data Not Importing via WordPress XML (WPXML)
- This topic has 9 replies, 2 voices, and was last updated 11 years, 5 months ago by
Barry.
-
AuthorPosts
-
November 10, 2014 at 10:37 am #874203
Robert
ParticipantI checked the forums for similar topics and could not find any. We have created a custom WordPress XML (WPXML) export from our proprietary events management system to be able to migrate to Events Calendar PRO. We have filled in all meta-data fields for the Venue address (city/state/zip/etc.), however in the admin once the Venues import, all of these fields are blank. The checkboxes for showing Google Maps and Google Maps Links are in fact checked (set to true in the export), but everything else is blank or default menu values. Options to regenerate geolocation data do not show up in the settings, and the “merge duplicates” button does not seem to help. Is there some key piece of data we are missing to make this work? We need to able to export this meta-data for venues to be able to be geolocated and displayed on the map. Thanks!
November 10, 2014 at 4:58 pm #875009Barry
MemberHi msia,
We can’t always help with more advanced custom development tasks such as this one – but I’d be happy to throw some ideas around and see if we can get anywhere 🙂
What if you create a venue manually? Are you able to ascertain any differences between the post meta for that venue and the post meta for one of your imported venues?
Can you share the results of a SELECT * for one of your imported venues and the corresponding postmeta rows so I can take a peek? (Bear in mind the forum isn’t currently a great venue for sharing code, so making use of services like Pastebin or Gist may be better for sharing this sort of thing.)
Thanks!
November 13, 2014 at 2:41 am #881658Robert
ParticipantHi Barry,
I’ll try creating a venue manually, exporting, and importing to another vanilla test instance of WP. I’ll also check the underlying SQL data. I was just wondering if there were known “gotchas” here about the WPXML export/import process (like, e.g., it’s incomplete).
I’ll try some things and keep you posted. Thanks for being willing to kick around ideas.
Best,
RobertNovember 13, 2014 at 8:32 am #882328Robert
ParticipantHi Barry,
So I did some “vanilla” export/import operations on Venues and discovered that all the fields do indeed map across correctly. So, armed with this I revisited our export and found an issue with how we were nesting one of the meta key/value pairs. That resolved, we now have correct venue location fields filled in! Yay!
However, after the import, the _VenueGeoAddress, _VenueLat, and _VenueLng fields aren’t being set by the script. If I go in and manually click “update” on a Venue, it will generate this data and plot the venue location on the Map view. But, as with our other ticket on getting recurrence to populate after import, it would be really nice, in fact quite important, to find a way to do this kind of updating programmatically instead of manually. Doing our own lat/lng geocoding for the export from our proprietary event system will really slow the export down.
So, do you know how we can trigger the hooks that get activated on a manual web admin update of a Venue (in this case, and an Event in the case of our other post) to be able to activate all of those “magic” functions in the plugin that populate the data set correctly based on the user input?
Thanks for your help!
Best,
RobertNovember 13, 2014 at 9:18 am #882469Barry
MemberHi Robert,
You could try calling the relevant method programmatically:
TribeEventsGeoLoc::instance()->generate_geopoints_for_all_venues()Setting that to run sometime after or during the init action would probably be wise – if you call it too early it may fail for a variety of reasons 🙂
Good luck!
November 13, 2014 at 9:31 am #882537Robert
ParticipantThanks, Barry, we’ll give that a try. We are using wp-cli, so the ‘eval’ command there might be just what we need in terms of fully intialising WordPress and all of the plugins before executing this code. I’ll let you know!
November 13, 2014 at 9:37 am #882557Robert
ParticipantHi Barry,
Unfortunately, running:
wp eval '$t = TribeEventsGeoLoc::instance(); var_dump($t->generate_geopoints_for_all_venues());'
gives back the integer value of zero (0). Do you think that could be because wp-cli is executing too soon? Or is it more likely to be some issue with the dataset? Again, when we manually update individual Venues in the wp-admin, they geocode just fine.
Thanks for any thoughts you can spare!
November 13, 2014 at 10:07 am #882606Robert
ParticipantHey Barry,
I just wanted to update to give some good news. I inspected the code for the TribeEventsGeoLoc class, and it looks like it just assumes geolocation has already happened correctly if the _VenueGeoAddress property has been set. Our export was setting that value explicitly (but not setting _VenueGeoLat or _VenueGeoLng). Once we removed that, the script was able to detect that a geocoding was needed and execute. So, in the end, running:
wp eval 'TribeEventsGeoLoc::instance()->generate_geopoints_for_all_venues()'from the command line did in fact loop through all of our outstanding venues and geocode them!
Many thanks for your help.
Best,
RobertNovember 13, 2014 at 10:08 am #882610Robert
ParticipantThis reply is private.
November 13, 2014 at 12:37 pm #882878Barry
MemberGlad you got there (and thanks also for sharing the notes – they could definitely be helpful for others in a similar spot in the future).
Thanks again!
-
AuthorPosts
- The topic ‘Venue Location Data Not Importing via WordPress XML (WPXML)’ is closed to new replies.
