Import function doesn't create events

Home Forums Calendar Products Community Events Import function doesn't create events

Viewing 15 posts - 1 through 15 (of 29 total)
  • Author
    Posts
  • #1020204
    Jacob
    Participant

    dear Tribe team,

    My imports (reocurring) do find events (ics url) but they won’t import any. Can you check this out, or do you have any ideas why this might not work?

    Best,
    Jacob

    #1020356
    Nico
    Member

    Hi Jacob,

    Thanks for reaching out to us! I’ll try to help you out here…

    Can you send me over the source and settings for this imports so I can test this on my end? Also we have a known bug with recurring events import in saved imports – a fix for this is already being developed. Do you think this might be your case?

    Have a great weekend,
    Nico

    #1020361
    Jacob
    Participant

    This reply is private.

    #1020707
    Nico
    Member

    Hi Jacob,

    Thanks for following up with the feed URL, and sorry for the delay but we do not monitor the forums during the weekends.

    I’ve tested this locally and I could import all the events in the feed without problem. Could it be that you imported and deleted this sames events previously? The plugin saves a the imported-then-deleted events in the database to prevent them from being re-imported. Maybe this is the case? I can provide a snippet to clean those up and allow the full re-import again.

    If the above doesn’t seem to be the case I suggest following the steps described in our Testing for conflicts guide? This way we can see if this is a problem in our plugin or a conflict with the theme or other installed plugins.

    Please let me know about this,
    Best,
    Nico

    #1022305
    Jacob
    Participant

    Dear Nico,

    Yes, this exactly is my case. I have imported & deleted them before to test something. Please help me with that snippet.

    Yours
    Jacob

    #1022599
    Nico
    Member

    Hey Jacob,

    Here’s the code to delete the ‘deleted events notes’. Add this to your functions.php file and it will delete 50 ‘notes’ per page load, once it finishes deleting (shows the message) comment the snippet out!

    /* 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!';
    }

    This will allow the deleted instances to be re-imported. If you want to disable this behavior then add this other 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' );

    Please give that code a try and let me know about it,
    Have a great weekend,
    Nico

    #1022690
    Jacob
    Participant

    Hey Santo,

    The code causes a 500 error on my server. My host wpengine.com says that I definitely needed another workaround due to the ‘nginx’ (i dont know what this is) they are using. Do you have another way to empty that list? I just need it once.

    Best,
    Jacob

    #1023212
    Nico
    Member

    Hey Jacob,

    Thanks for following up! I find it really strange that this code not working due to server configuration as it’s very simple and uses default WordPress functions. Maybe you are inserting it in the wrong place? Can you share with me the full functions.php code so I can take a look at it? You can share via GIST (or any other code sharing service), make sure to mark the reply as private.

    Another way of doing this would be to directly modify the site’s database, deleting entries with post_type = deleted_event from the wp_posts table. Be sure to back up the table first in case the edit goes wrong!

    Please let me know so I can continue to help you on this,
    Best,
    Nico

    #1023291
    Jacob
    Participant

    This reply is private.

    #1023546
    Jacob
    Participant

    This reply is private.

    #1023602
    Jacob
    Participant

    This reply is private.

    #1024030
    Nico
    Member

    This reply is private.

    #1024103
    Jacob
    Participant

    Hi Nico,

    I have executed the query and got the message that 0 entries have been deleted.

    Best,
    Jacob

    #1024104
    Jacob
    Participant

    This reply is private.

    #1024297
    Nico
    Member

    This reply is private.

Viewing 15 posts - 1 through 15 (of 29 total)
  • The topic ‘Import function doesn't create events’ is closed to new replies.