Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Parsed 0 events from ical sources" from Moodle Calendar URL export #177

Closed
hambergerpls opened this issue Jan 2, 2021 · 8 comments
Closed
Labels
bug Something isn't working

Comments

@hambergerpls
Copy link

Hi, I'm trying to import a Moodle calendar URL link into the script but it did not fetch any events from the url

URL: https://smartv3.ums.edu.my/calendar/export_execute.php?userid=50129&authtoken=3240f8f614fb86a8445eda299e87fd6a85ca5afd&preset_what=all&preset_time=recentupcoming

Log:

Jan 2, 2021, 3:41:55 PM	Info	Result: 1
Jan 2, 2021, 3:41:55 PM	Info	Syncing 1 calendars to SmartUMS
Jan 2, 2021, 3:41:55 PM	Info	Working on calendar: [email protected]
Jan 2, 2021, 3:41:55 PM	Info	Fetched 0 existing events from SmartUMS
Jan 2, 2021, 3:41:55 PM	Info	Parsed 0 events from ical sources
Jan 2, 2021, 3:41:55 PM	Info	Processing 0 events
Jan 2, 2021, 3:41:55 PM	Info	Done processing events
Jan 2, 2021, 3:41:55 PM	Info	Checking 0 events for removal
Jan 2, 2021, 3:41:55 PM	Info	Done checking events for removal
Jan 2, 2021, 3:41:55 PM	Info	Processing 0 Recurrence Instances!
Jan 2, 2021, 3:41:55 PM	Info	Sync finished!

When I input the URL in the browser, it downloads the .ics file and I'm able to import it to Google Calendars with the events, but when I use the URL directly in Calendar, it couldn't find any events. I also noticed that the URL is not in iCal format, so I'm not sure if that is the cause.

@hambergerpls hambergerpls added the bug Something isn't working label Jan 2, 2021
@jonas0b1011001
Copy link
Collaborator

The URL returns an empty calendar. Does it require some additional type of authentication?

@hambergerpls
Copy link
Author

I don't think it requires any additional authentication since the link downloads the icalexport.ics file if I try the link in incognito but it didn't work when I import through URL in Google Calendar and GAS.

The body response I got from postman is this:

BEGIN:VCALENDAR
METHOD:PUBLISH
PRODID:-//John Papaioannou/NONSGML Bennu 0.1//EN
VERSION:2.0
END:VCALENDAR

@derekantrican
Copy link
Owner

So it looks like the ICS is being returned, but is empty. I would expect an auth issue would mean you get nothing back. Maybe something isn't set up properly for publishing in Moodle? Or maybe there's no events that match the "filters" you have in the URL (preset_what=all&preset_time=recentupcoming)?

I also noticed that the URL is not in iCal format

Likely not an issue - a URL doesn't have to end in ".ics" or ".ical" to be a valid calendar.

the link downloads the icalexport.ics file if I try the link in incognito

Are you willing to share this?

@derekantrican
Copy link
Owner

I see this, are you referencing those directions? https://docs.moodle.org/310/en/Using_Calendar#Dynamic_Link_to_Moodle_Calendar

@hambergerpls
Copy link
Author

I see this, are you referencing those directions? https://docs.moodle.org/310/en/Using_Calendar#Dynamic_Link_to_Moodle_Calendar

Yes

So it looks like the ICS is being returned, but is empty. I would expect an auth issue would mean you get nothing back. Maybe something isn't set up properly for publishing in Moodle? Or maybe there's no events that match the "filters" you have in the URL (preset_what=all&preset_time=recentupcoming)?

I also noticed that the URL is not in iCal format

Likely not an issue - a URL doesn't have to end in ".ics" or ".ical" to be a valid calendar.

the link downloads the icalexport.ics file if I try the link in incognito

Are you willing to share this?

Okay I felt silly for not being thorough. I didn't realise that there were a size difference in ics file when I try in incognito and when I try it while logged into my Moodle. It does require an authentication to get the events

Here's the result
icalexport.ics (While logged in)

BEGIN:VCALENDAR
METHOD:PUBLISH
PRODID:-//John Papaioannou/NONSGML Bennu 0.1//EN
VERSION:2.0
BEGIN:VEVENT
UID:[email protected]
SUMMARY:WEEK 11: Designing mobile apps &amp\; web should be completed
DESCRIPTION:Week 11 class will be conducted through async mode. Students ar
	e required to watch the lecture using the provided link. \n\n
	
CLASS:PUBLIC
LAST-MODIFIED:20201228T000947Z
DTSTAMP:20210103T014714Z
DTSTART:20210101T160000Z
DTEND:20210101T160000Z
CATEGORIES:KP34703 [1-2020/2021]
END:VEVENT
BEGIN:VEVENT
UID:[email protected]
SUMMARY:WEEK 11: Group Activity Submission - async mode
DESCRIPTION:Each GROUP is required to audit their SmartHome apps design usi
	ng the 25 principles proposed by Google Team (only 6 principles has been ex
	plained in the video).\n\nProvide a special checklist report consist of the
	 evaluation of your SmartHome apps. \n
	
... (TRIMMED)

CLASS:PUBLIC
LAST-MODIFIED:20201230T235250Z
DTSTAMP:20210103T014714Z
DTSTART:20210115T155500Z
DTEND:20210115T155500Z
CATEGORIES:KP00703 [1-2020/2021]
END:VEVENT
END:VCALENDAR

@derekantrican
Copy link
Owner

Ok, may be related to #157? I might contact you later to test out that feature

@jonas0b1011001
Copy link
Collaborator

I did a quick test on the Moodle Demo Page and the export link created on there seems to work fine regardless of incognito mode on/off.

As this does not look like a general Moodle problem maybe the admins of your uni's webpage can help you out with this one.

@ProgramComputer
Copy link

ProgramComputer commented Aug 26, 2021

I think this can help with this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants