-
Bug
-
Resolution: Duplicate
-
Critical
-
None
-
3.3.2
-
None
-
Windows, Linux, FreeBSD
-
MySQL
-
MOODLE_33_STABLE
Using Moodle 3.3.2 (2017051502.00), it is not possible to do a calendar export in iCal format without passing a valid session ID.
It works when saving the .ics file from the browser (due to the MoodleSession cookie being set), but integration with external calendar systems, such as Outlook, is broken due to this.
GET'ing the export URL using cURL returns a blank vcalendar:
$ curl "http://moodle.dk/calendar/export_execute.php?userid=1234&authtoken=abc123&preset_what=all&preset_time=monthnow"
|
BEGIN:VCALENDAR
|
METHOD:PUBLISH
|
PRODID:-//John Papaioannou/NONSGML Bennu 0.1//EN
|
VERSION:2.0
|
END:VCALENDAR
|
However, when passing the session ID from my browser cookie, all events get exported as expected:
$ curl "http://moodle.dk/calendar/export_execute.php?userid=1234&authtoken=abc123&preset_what=all&preset_time=monthnow" -H 'Cookie: MoodleSession=abc123'
|
BEGIN:VCALENDAR
|
METHOD:PUBLISH
|
PRODID:-//John Papaioannou/NONSGML Bennu 0.1//EN
|
VERSION:2.0
|
BEGIN:VEVENT
|
UID:12345@moodle.dk
|
SUMMARY:Summary
|
DESCRIPTION:Description\n
|
|
CLASS:PUBLIC
|
LAST-MODIFIED:20170922T091419Z
|
DTSTAMP:20170922T151015Z
|
DTSTART:20170901T100500Z
|
DTEND:20170901T100500Z
|
CATEGORIES:Category-Name
|
END:VEVENT
|
END:VCALENDAR
|
At first, I thought this was related to MDL-59650 (calendar incomplete ($limitnum = 40)) or MDL-60054 (Not all events are shown i overview calendar), but it appears to be an entirely different issue.
The problem began after upgrading Moodle from 3.2.x to 3.3.2.
I have successfully reproduced this issue under the following environments:
- PHP 7.0.23 / Nginx 1.12.1 / Ubuntu 14.04
- PHP 5.6.31 / Nginx 1.13.5 / FreeBSD 11.1
- PHP 7.1.9 / IIS 10.0 / Windows Server 2016
- PHP 5.6.31 / IIS 10.0 / Windows Server 2016