Home › Forums › Calendar Products › Events Calendar PRO › iCal single event import file creates new calendar
- This topic has 7 replies, 3 voices, and was last updated 9 years, 10 months ago by Barry.
-
AuthorPosts
-
June 18, 2014 at 4:25 pm #234156pagedesignParticipant
We have ECP installed on a WordPress site for a client and they are having issues when trying to import an iCal file for a single event into Outlook. The import file creates a new calendar rather than importing the event into their existing calendar.
The .ics file includes this line which looks to be the culprit:
“X-WR-CALDESC:Events for O-Ring”I’ve looked around the forums and there seems to be a workaround from a previous version of the plugin from 2012 – https://tri.be/support/forums/topic/ical-import-how-do-we-get-it-to-add-event-to-an-existing-calendar-in-outlook/ – involving modifying the plugin files, but I wasn’t able to access the MDNW link in the thread to even try patching it (and am hoping not to have to refix it every update).
Is there any other known workaround or snippet to add to the functions file to remove that line from the .ics file for single events?
Thanks!
June 18, 2014 at 4:41 pm #234180pagedesignParticipantActually, its probably this line in the .ics file:
“X-WR-CALNAME:O-Ring”June 19, 2014 at 6:43 am #235363BarryMemberHi!
There is a hook in place to help with just this sort of problem – tribe_ical_properties – and it’s basic usage is as follows:
add_filter( 'tribe_ical_properties', 'modify_ical_output' ); function modify_ical_output( $ics ) { $find_this = "X-WR-CALDESC:Events for {something} \r\n"; $replace_with = ''; // Remove completely return str_replace( $find_this, $replace_with, $ics ); }
Does that help here? It should certainly remove the need to modify core plugin code and reinstate your changes with every update.
June 19, 2014 at 7:51 am #235537Andy FragenModeratorFor the record the previous hack does not alter the core plugins files and is meant to be placed in your theme’s functions.php file, just like Barry’s code.
June 19, 2014 at 7:53 am #235538Andy FragenModeratorI’m referring to gist.github.com/afragen/2831526
June 19, 2014 at 7:54 am #235539Andy FragenModeratorOops, should be https://gist.github.com/afragen/2831526
June 19, 2014 at 11:10 am #235853pagedesignParticipantThanks Barry, that worked perfectly.
I’m sort of in that beginner to intermediate level of plugin development, so I apologize if the info about the ‘tribe_ical_properties’ hook was readily available/common knowledge. And thanks for the input Andy. I must have misunderstood the fix in the previous thread; I thought it needed to be combined with a modification of a core file to work properly.
Thanks again guys!
June 20, 2014 at 5:48 am #237939BarryMemberGlad it’s all sorted 🙂
-
AuthorPosts
- The topic ‘iCal single event import file creates new calendar’ is closed to new replies.