Bug in “Export Outlook .ics file”
-
Looking at the code in /the-events-calendar/src/Tribe/iCal.php I see:
? ? /** ? ? ?* Get the start of the .ics File ? ? ?* ? ? ?* @since 5.16.0 - Add a check for iCAL type to prevent Outlook ics from including X-WR-CALNAME. ? ? ?*/ ? ? protected function get_start() { ? ? ? ? ... ? ? ? ? if ( ! empty( $x_wr_calname ) && 'ical' === $this->type ) { ? ? ? ? ? ? $content .= 'X-WR-CALNAME:' . $x_wr_calname . "\r\n"; ? ? ? ? }
I have enabled my calendar to have the “Export Outlook .ics file” option with this:
add_filter( 'tec_views_v2_subscribe_link_outlook-ics_visibility', '__return_true' );
The core problem is, the generated .ics file still has X-WR-CALNAME: in it. This causes extra prompts/clicks when the user tries to open the .ics with Outlook.
It appears as though this code assumes that the “Export Outlook .ics file” link is formatted as https://website.com/events/event-link?outlook-ical=1, but the link that is generated is https://website.com/events/event-link?ical=1
The bug appears to be in /the-events-calendar/src/Tribe/Views/V2/iCalendar/Links/Outlook_Export.php:? ? public function get_uri( View $view = null ) {
? ? ? ? if ( null === $view || is_single( Tribe__Events__Main::POSTTYPE ) ) {
? ? ? ? ? ? // Try to construct it for the event single.
? ? ? ? ? ? return add_query_arg( [ 'ical' => 1 ], get_the_permalink() );
? ? ? ? }Instead of ‘ical’, it seems like we need this to be ‘outlook-ical’ to get it to function correctly.
? ? ? ? ? ? return add_query_arg( [ 'outlook-ical' => 1 ], get_the_permalink() );
- The topic ‘Bug in “Export Outlook .ics file”’ is closed to new replies.