Home › Forums › Calendar Products › Community Events › Import function doesn't create events
- This topic has 28 replies, 3 voices, and was last updated 8 years, 3 months ago by Support Droid.
-
AuthorPosts
-
October 30, 2015 at 6:54 am #1020204JacobParticipant
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,
JacobOctober 30, 2015 at 11:30 am #1020356NicoMemberHi 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,
NicoOctober 30, 2015 at 11:39 am #1020361JacobParticipantThis reply is private.
November 2, 2015 at 6:06 am #1020707NicoMemberHi 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,
NicoNovember 5, 2015 at 12:45 pm #1022305JacobParticipantDear Nico,
Yes, this exactly is my case. I have imported & deleted them before to test something. Please help me with that snippet.
Yours
JacobNovember 6, 2015 at 9:28 am #1022599NicoMemberHey 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,
NicoNovember 6, 2015 at 1:55 pm #1022690JacobParticipantHey 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,
JacobNovember 9, 2015 at 7:30 am #1023212NicoMemberHey 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,
NicoNovember 9, 2015 at 9:14 am #1023291JacobParticipantThis reply is private.
November 9, 2015 at 5:46 pm #1023546JacobParticipantThis reply is private.
November 9, 2015 at 11:47 pm #1023602JacobParticipantThis reply is private.
November 10, 2015 at 9:00 pm #1024030NicoMemberThis reply is private.
November 11, 2015 at 1:49 am #1024103JacobParticipantHi Nico,
I have executed the query and got the message that 0 entries have been deleted.
Best,
JacobNovember 11, 2015 at 1:50 am #1024104JacobParticipantThis reply is private.
November 11, 2015 at 11:19 am #1024297NicoMemberThis reply is private.
-
AuthorPosts
- The topic ‘Import function doesn't create events’ is closed to new replies.