Error in iCal Export template
-
Hi,
I encounter an issue regarding the iCal Export template button from a single event view.
The errors I got is “Cannot modify header information – headers already sent by…” This issue appears because you have some code inside your
Tribe__Events__iCal
class that is called after some output in the browser. Here are the lines the error report points to:$filename = apply_filters( 'tribe_events_ical_feed_filename', $site . '-' . $hash . '.ics', $post ); header( 'Content-type: text/calendar; charset=UTF-8' ); header( 'Content-Disposition: attachment; filename="' . $filename . '"' );
This code is run once the hook
tribe_tec_template_chooser
is called which is too late.
By changing the hook name to a more appropriate one:template_redirect
, no more errors were triggered and the plugin runs smoothly.I suggest you to test this. So inside your
Tribe__Events__iCal
class in the static methodinit
, replace the hooktribe_tec_template_chooser
totemplate_redirect
. Test it and let us know when there is an update to this.Here we keep the altered plugin on our development but it would be best if it is fixed generally.
The error and fix is working on plugin version 4.2.1, we’re going to check version 4.2.1.1 as well. It runs on PHP 5.6.
Here is a link to changed code (image): https://cloudup.com/c5wYbNiQfnz
The project is under local development so no access to it but if you need more information, do not hesitate to ask.
Regards,
- The topic ‘Error in iCal Export template’ is closed to new replies.