Home › Forums › Calendar Products › Event Aggregator › iCal import worked once, now "Your search returned no results" every time
- This topic has 9 replies, 3 voices, and was last updated 10 years, 1 month ago by
Support Droid.
-
AuthorPosts
-
November 22, 2015 at 5:32 am #1029088
tjkelly
ParticipantImported 500 events from Google Calendar. Decided I didn’t want them all. I deleted all of them (and emptied Trash).
I’ve been trying to import them again from both an ICS file and an ICS URL (both public and private). In all cases, I get an error that says “Your search returned no results. Please adjust your search.”
Any idea what I’m doing wrong?
November 22, 2015 at 9:15 am #1029295tjkelly
ParticipantFor additional info:
On my staging URL, I disabled all other plugins and switched to Twentyfifteen theme. I tried the import again from an .ics file and I got a new error: “Unable to retrieve content from the provided URL.”
I tried a different .ics file for testing and it worked perfectly. Does that mean my .ics is corrupt or too big or something?
November 23, 2015 at 2:58 pm #1029844Nico
MemberHowdy @tjkelly,
Welcome to our support forums and thanks for reaching out to us. I’ll help you here!
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). I guess you are falling into this behavior!
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 behaviour:
/*
* 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,
Best,
NicoNovember 23, 2015 at 7:06 pm #1029901tjkelly
ParticipantThanks Nico. I’m leaving this “I still need assistance” because I have a few follow-up questions.
1) From your answer:
Add this snippet to your theme functions.php file and re-load the page
Your instruction makes it sound like I should load my functions.php directly? But there are a number of problems with that, not the least of which is that
get_postsis undefined. Did you mean I should load the iCal import page? The code isn’t wrapped in any function or hook, so I’m curious how that’s intended to work.2) In order to run the code in your snippet, I converted it to a shortcode and pasted the shortcode in a post. I immediately got the ‘Done deleting!’ message, despite have 490 records in the database of type ‘deleted_event’.
- I tried adjusting the ‘numberposts’ param to see if it any affect. It did not.
- I var_dump’d $posts and it returned an empty array.
What am I doing wrong?
3) Lastly, now that I know about the ‘deleted_evet’ post type, I queried it in my wp_posts table and deleted the 490 records. That seems to have worked because my latest import attempt brought up results as expected.
So the question here is: is it ok to delete those post records in phpmyadmin? Could that have any unforeseen consequences? (This is all on my staging site so I don’t mind breaking things right now. Just want to be sure for when I deploy!)
Edit: Now that I’ve said that it worked as expected, I’m changing my mind:
- The import looked good and the results looked right
- When I load my /edit.php?post_type=tribe_events admin page, I don’t see any events
- When I access my public-facing schedule page, I don’t see any events
Now what? Were those events not actually imported, despite how the import looked?
Thanks very much.
-
This reply was modified 10 years, 4 months ago by
tjkelly. Reason: Additional info
November 24, 2015 at 6:47 am #1030185Nico
MemberHey @tjkelly,
Thanks for following up on this! I’ll try to clarify a bit on this…
Did you mean I should load the iCal import page? The code isn’t wrapped in any function or hook, so I’m curious how that’s intended to work.
Just adding it to functions.php and running any page on the back or the front end should make the code run. You can hook it to init action as well.
Regarding #2… What am I doing wrong?
Not sure at all on this.
So the question here is: is it ok to delete those post records in phpmyadmin? Could that have any unforeseen consequences?
Yeap, this is fine too. Just be sure not to delete any actual events!
Now what? Were those events not actually imported, despite how the import looked?
I’m not sure about the question, What do you mean by “despite how the import looked?”. If the events were “found” that means the “deleted events saved notes” were successfully cleared, now you should be able to re-import those events or any others.
Please let me know about it,
Best,
NicoNovember 24, 2015 at 8:30 pm #1030465tjkelly
ParticipantIf the events were “found” that means the “deleted events saved notes” were successfully cleared, now you should be able to re-import those events or any others.
They were “found,” when I ran the import. So I set the frequency to every 30 mins, but none appeared in my Events list, even after 24 hours.
Do I need to do something manually to make it start pulling events from the iCal URL every 30 mins?
November 25, 2015 at 11:41 am #1030922Nico
MemberHi @tjkelly,
Thanks for following up!
The import should import the events automatically if it’s configured correctly. Please try to do a one-time import of those so we can see if it’s an issue with the events or an issue with the recurring import. Also please review the following articles to better understand how the plugin works, and how to configure it correctly:
- New User Primer: iCal Importer
- Running a one-time import with the iCal Importer
- Running a saved recurring import with the iCal Importer
- iCal Importer and WordPress scheduled tasks
Please give the on-time import a try and let me know,
Best,
NicoNovember 27, 2015 at 5:24 am #1031357tjkelly
ParticipantI read through the articles, thank you for sharing them. I ran the one-time import and it brought in 80+ events. Things look good there.
But.
Here’s a screenshot of my Saved Recurring Imports screen. I set this up 2 days ago to run every 30 minutes and it says it hasn’t run in 2 days.
I don’t know if any new events have been added to the Google Calendar in the last 2 days (I don’t maintain the calendar, just the website displaying it). But I’d still expect to see the “Last Update” date be more recent, even if there were no new events found.
November 30, 2015 at 7:46 am #1032622Nico
MemberHey @tjkelly,
Glad you could finally import those events 🙂
Regarding the auto-import, that seems to be a different issue which will require a new round of trouble shooting to begin with.
Please set up a simple Google Calendar of your own with a some events, then set up an auto-import to run every 30 minutes and add a couple new events after the initial import. Bear in mind, that WordPress cron might not work as true cron as described in the article iCal Importer and WordPress scheduled tasks.
Let me know about your findings and we’ll try to get to the bottom of this issue,
Best,
NicoFebruary 18, 2016 at 8:32 am #1075839Support Droid
KeymasterThis topic has not been active for quite some time and will now be closed.
If you still need assistance please simply open a new topic (linking to this one if necessary)
and one of the team will be only too happy to help. -
AuthorPosts
- The topic ‘iCal import worked once, now "Your search returned no results" every time’ is closed to new replies.
