Google Calendar Can't Import

Home Forums Calendar Products Event Aggregator Google Calendar Can't Import

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1162512
    Denis Downie
    Participant

    I had duplicate events after importing a google calendar on my development site. I decided to start over and deleted all the previous events. However now that I’m trying to re-import the events, the link doesn’t seem to work and no events are being found for importing? I’m not sure if it’s a bad link or some other issue. Some help would be appreciated. I tried looking over forums and doing other suggested fixes such as using other addons to clear the database of trashed items.

    #1162842
    Geoff
    Member

    Hi @friendsofmttam,

    So sorry for the trouble here!

     

    What you describe is the default behaviorĀ of the plugin: once you import an event via iCal Importer and then delete it the system stores a “note” so that deleted events are not re-imported (as this would be the desired behavior for most cases and for automatic imports as well).

    To delete saved “deleted events notes”

    Add this snippet to your theme functions.php file and re-load the page (it will run once per page-load) until the message is shown, after that remove or comment the script:

    /* Deletes 50 posts per page load*/
    $posts = get_posts( array( 'numberposts' => 50, 'post_type' =>'deleted_event') );
    if (!empty($posts)) {
    foreach ($posts as $post) {
    wp_delete_post( $post->ID, true);
    }
    } else {
    echo 'Done deleting!';
    }

    To prevent “deleted events notes” from being created in the future

    Add this other snippet to modify this default behavior:

    /*
    * Prevents iCal importer from saving a copy of "deleted" events
    */
    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' );

    Please let me know if you get the events to show again after using the snippets.

    Cheers!
    Geoff

    #1172335
    Support Droid
    Keymaster

    Hey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.

    Thanks so much!
    The Events Calendar Support Team

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Google Calendar Can't Import’ is closed to new replies.