Venue Location Data Not Importing via WordPress XML (WPXML)

Home Forums Calendar Products Events Calendar PRO Venue Location Data Not Importing via WordPress XML (WPXML)

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #874203
    Robert
    Participant

    I 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!

    #875009
    Barry
    Member

    Hi 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!

    #881658
    Robert
    Participant

    Hi 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,
    Robert

    #882328
    Robert
    Participant

    Hi 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,
    Robert

    #882469
    Barry
    Member

    Hi 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!

    #882537
    Robert
    Participant

    Thanks, 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!

    #882557
    Robert
    Participant

    Hi 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!

    #882606
    Robert
    Participant

    Hey 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,
    Robert

    #882610
    Robert
    Participant

    This reply is private.

    #882878
    Barry
    Member

    Glad 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!

Viewing 10 posts - 1 through 10 (of 10 total)
  • The topic ‘Venue Location Data Not Importing via WordPress XML (WPXML)’ is closed to new replies.