Importing a CSV with custom fields

Home Forums Welcome! Pre-Sales Questions Importing a CSV with custom fields

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #970788
    Liz
    Guest

    Hi – Like a number of people who have posted to the forum, I need to import a CSV that includes custom fields. As suggested here, I tried another CSV import plugin.

    I have been able to successfully set up the plugin (WP All Import) to import both the default fields and my custom fields — the imported events show up as usual in the list view and when I click into an event all the fields are populated correctly. However, events don’t show up on the front end until I go into each one individually and click “Update.” It is not necessary to actually make any edits, and it doesn’t work if I try to use the bulk edit function.

    Any idea what’s going on and how I can fix it?

    Thanks.

    #971129
    George
    Participant

    However, events don’t show up on the front end until I go into each one individually and click “Update.”

    Thanks for reaching out Liz. The essence of your specific issues seems to be what I quoted above – in other words, that everything is importing fine, but the events need to be manually saved post-update to actually publish on the front-end of your site…

    …It’s possible that this is something limited by the way your chosen importer plugin works. While we unfortunately don’t support any plugins other than our own, I’m curious if, after importing, you can see what the “status” of an event is – do you notice if it’s set to “Draft”, or “Pending Review”, or anything like that? Or is set to “Published”, but you still have to make the manual updates you mention here?

    If you haven’t already, I’d recommend looking for similar issues in the support forums for your importer plugin – perhaps this is a known/fixable issue with the importer itself.

    Let us know what you find if you do that, thank you Liz!

    #972356
    Eric Maynard
    Guest

    Hi Liz,

    Facing exact same scenario here as well attempting to import from WP AI. Just as you describe, imported as Published, however, until you actually edit individually.

    Through trial and error comparison of updates, I thought it might be related to the fact that the _edit_lock and _edit_last meta values are not populated by default using WP AI, but even setting these values to some reasonable defaults, the same behavior is observed.

    There must be some other WP internal process that WP AI is missing when it saves a record.

    Please post any solution you might find and I promise to do the same.

    thanks,
    Eric

    #972380
    George
    Participant

    Thanks for sharing that information Eric! We’ll keep this thread open for some time now to encourage the sharing of any solutions here – for anyone else coming along to this thread, with separate issues, please open a new thread so that we can get to your specific issues as fast as possible.

    Cheers!
    George

    #972705
    Eric Maynard
    Guest

    Hi George,

    What is so strange about the whole thing is that the entries will display in both the Widget and List views, but not in the Month view. To my thinking, that implies an issue with the view process and not so much the import process. It wasn’t my intention to hi-jack this thread, so if we continue to experience issues I will be certain to post independently.

    thank-you
    Eric

    #973350
    Liz
    Guest

    Hi George & Eric — thanks for the input.

    Thanks to the excellent customer support people at WP All Import, I have found a solution — sort of. It appears to be an issue with the date and time formats and Excel. The dates in my CSV file are saved as MM/DD/YY by Excel. Your CSV importer apparently automatically translates it to YYYY-MM-DD (because the import worked fine when I used your importer) but WP AI does not. It’s actually weird, because everything looks fine on the back end — the dates show as YYYY-MM-DD — but apparently it doesn’t really register until I click Update.

    If I go into Excel and reformat the date column so it shows as YYYY-MM-DD, the import process works. Unfortunately, I can’t convince Excel not to reformat the dates once I close the file, so it actually has to be open on my computer while I do the import. I tried resetting the default date format in my computer’s settings but Excel still only mostly gets it right — the dates show as YY-MM-DD, which doesn’t work either. If anyone has any ideas about how to get around this, I’d love to hear them.

    The same thing applies to the time format: it needs to be HH:SS:MM and Excel drops the leading 0 if it’s before 10:00am (which almost all of my events are). So again, you have to explicitly format it with a custom format and leave the file open when you import.

    I’m still having a little trouble — I just imported a set of 17 events and 16 of them worked. The last one doesn’t have an organizer so I’m wondering if that’s the issue. I’m working on how to explicitly handle that case.

    George, if any of this gives you any ideas about a better way to fix the issue, I would love to hear it!

    Thanks,
    Liz

    #973421
    Liz
    Guest

    For the record, this issue hasn’t really been solved and George’s reply (with all due respect and appreciation to George) was not the correct answer. The events were uploaded in Published status, so that wasn’t the issue. Working on the date formats has helped some, but there are still unresolved problems.

    I agree with Eric — there appears to be something going on with the month view. With correctly formatted dates, I can get events in June to show up on the calendar, but a July calendar page isn’t created even though events for July have been imported. If I go into one of the July events and click update, then the July calendar page gets created and all of the July events show up. While this wouldn’t be a big deal if it were the only issue, the import process as a whole is too unwieldy to offer to my client.

    Any additional assistance anyone can provide would be greatly appreciated.

    Thanks,
    Liz

    #973691
    George
    Participant

    Hi Liz (and Eric),

    I’m sorry about your continued frustration with importing here. Unfortunately, the essence of your problems come down to something with WP All Importer, a plugin we do not make and do not offer customer support for.

    And Liz, what you mentioned reveals a lot about the nature of the problems:

    With correctly formatted dates, I can get events in June to show up on the calendar, but a July calendar page isn’t created even though events for July have been imported. If I go into one of the July events and click update, then the July calendar page gets created and all of the July events show up.

    So it seems that WP AI is not setting the status to “Published” upon import. If it did, then it stands to reason that these issues related to the events statuses not being “Published” would be resolved.

    I’m sorry that we’ve hit a bit of a wall here, but at core this seems like a code-related issue with WP AI about how it is importing the Events post type.

    One thing that might help is to point out the default WordPress importer and exporter tools include support for custom post meta → https://wordpress.org/plugins/wordpress-importer/. So if you export and then import each of the Events, Venues, and Organizers post types, the data should be transferred without issue.

    Please let me know what your thoughts are on all this information – I cannot speak for code-related things within WP AI that aren’t allowing successful imports of our pretty standard, normal, and definitely code-compliant Events post type. But I can and will do anything else I can do help make this right with you guys – try out the default WordPress import/export tools if you haven’t and see if they help.

    Thank you,
    George

    #976004
    Karl
    Guest

    Hi Liz,

    My thread that you mentioned at the beginning of this post was closed a bit prematurely. I did hack a solution for this on my own system, up to you if you want to do the same. I may have broken the “update” function of the CSV Importer as all items are now put into the DB as new items. Or this is a problem with the latest Events Calendar? I really don’t know. Do you have the same problem, if you import a csv and then import it again does it update or add new posts?

    Anyway here’s what I did:

    In src/Tribe/Main.php added:

    			'EventImageURL',
    			'EventTableBooking',
    			'TheSecondImageURL',
    			'EventSubHead',
    			'EventAge',
    			'EventOpeningHours',
    			'EventPhotoCredit',	

    under
    '_EventHideFromUpcoming',

    In Importer/File_Importer_Events.php added:
    `’EventImageURL’ => $this->get_value_by_key( $record, ‘event_image_url’ ),
    ‘EventTableBooking’ => $this->get_value_by_key( $record, ‘event_table_booking’ ),
    ‘EventSecondImageURL’ => $this->get_value_by_key( $record, ‘event_second_image_url’ ),
    ‘EventSubHead’ => $this->get_value_by_key( $record, ‘event_sub_header’ ),
    ‘EventAgeRestrictions’ => $this->get_value_by_key( $record, ‘event_age_restrictions’ ),
    ‘EventOpeningHours’ => $this->get_value_by_key( $record, ‘event_opening_hours’ ),
    ‘EventPhotoCredit’ => $this->get_value_by_key( $record, ‘event_photo_credit’ ),`
    under
    'EventURL' => $this->get_value_by_key( $record, 'event_website' ),

    and lastly in Column_Mapper.php added:

    			'event_image_url'  	   => __( 'Primär bild-url', 'tribe-events-calendar' ),
    			'event_table_booking'  	   	=> __( 'Bordsbokning', 'tribe-events-calendar' ),		
    			'event_second_image_url'	=> __( 'Sekundär bild-url', 'tribe-events-calendar' ),
    			'event_sub_header'			=> __( 'Underrubrik', 'tribe-events-calendar' ),
    			'event_age_restrictions'	=> __( 'Åldersbegränsning', 'tribe-events-calendar' ),
    			'event_opening_hours'		=> __( 'Öppettider', 'tribe-events-calendar' ),
    			'event_photo_credit'		=> __( 'Fotografens namn', 'tribe-events-calendar' ),

    under 'event_website' => __( 'Event Website', 'tribe-events-calendar' ),

    This worked for me but may break for you, I recommend using a testing environment!

    #976008
    Karl
    Participant

    The update problem wasn’t because of anything I did, the update problem was because the importer for some reason always handles events without a start time or and end time as new posts in the importer. I’d say this is a bug, you should be able to update all-day events the same way you can the others when you don’t have start time/end time hours. The importer needs some work.

    • This reply was modified 8 years, 9 months ago by Karl.
    #976282
    George
    Participant

    Hey folks,

    Our support/developer guru Brian gave me a heads-up that we’ve actually just recently found a bug here.

    The bug is the exact behavior described here: “All Day” events get imported twice, and/or don’t get saved as “Published”.

    We’re working hard on a fix and will have it ready for a public release as soon as possible!

    I’m sorry I was unaware of this thus far, but your patience with this issue has been super appreciated. Please stay tuned for a release, we’re working on a fix and take this bug quite seriously.

    Thank you!

    #988041
    Leah
    Member

    Hello,

    Thank you again for bringing this issue to our attention. We’re happy to say that we have added a fix for this into our upcoming version 3.11 release. Keep an eye on your Updates page for the new version. If you have any trouble with the update (or are still seeing this problem after you update) please start a new thread and we’d be happy to help out.

    Thank you for your patience while we got this release ready to go!

    Best,
    Leah
    and the rest of The Events Calendar team

    #988520
    George
    Participant

    🙂

Viewing 13 posts - 1 through 13 (of 13 total)
  • The topic ‘Importing a CSV with custom fields’ is closed to new replies.