• 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 method init, replace the hook tribe_tec_template_chooser to template_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,

    https://wordpress.org/plugins/the-events-calendar/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Julien

    (@jlambe)

    Tested as well on 4.2.1.1. The issue is still there but the fix is working perfectly.

    Thread Starter Julien

    (@jlambe)

    I’ve submitted a pull request on the Github repository, in its develop branch.

    Waiting for review.

    Best regards,

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Error in iCal Export template’ is closed to new replies.