Can not import events again (after deleting them)

Home Forums Calendar Products Event Aggregator Can not import events again (after deleting them)

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1023687
    Andreas
    Participant

    Hello!

    I imported events from a public Google Calendar and noticed a 2 hours difference for all events.
    So I deleted the wrong imported events, changed some timezone settings and wanted to try it again. But now I always get “Your search returned no results. Please adjust your search.”

    The Google Calendar is:
    https://calendar.google.com/calendar/[email protected]&ctz=Europe/Berlin

    I would appreciate any help to get the import work again – and hope I can solve the time issue afterwards..

    Thanks in advance!

    (I’m afraid I cannot easily deactivate all other plugins and switch to the default theme, because the site is an online shop, which needs to be accessible without interruptions.)

    #1023779
    Brian
    Keymaster

    Hi,

    I can help out here.

    This is by design. So that if you deleted an event it would not reimport on you.

    To do this we actually keep the deleted event in the database to check for it.

    This plugin can completely remove trashed events in the database:

    Optimize Database after Deleting Revisions

    It does not do it by default, but there is a setting to Delete Trashed Items.

    Before using that plugin it would be a good idea to backup your database just in case something goes wrong.

    For the future you can add this snippet:

    /*
    * Prevents iCal importer from saving a copy of "deleted" events
    * This means when you rerun an import, it will reimport any events you previously deleted
    */
    function tribe_ical_dont_save_deleted () {
    $ical_importer = Tribe__Events__Ical_Importer__Main::instance();
    remove_action( 'before_delete_post', array( $ical_importer, 'deletedEventSave' ) );
    }
    add_action( 'wp_loaded', 'tribe_ical_dont_save_deleted' );

    And that will not save a copy of the deleted event so you can reimport it.

    Let me know how that works out.

    Thanks

    #1024125
    Andreas
    Participant

    Thank you, this worked perfectly!

    #1024205
    Brian
    Keymaster

    Great, glad it helps, I am going to go ahead and close this ticket, but if you need help on this or something else please post a new ticket.

    Thanks!

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Can not import events again (after deleting them)’ is closed to new replies.