add-to-calendar-buttons
add-to-calendar-buttons copied to clipboard
Bug fix - generateCalendars() is called without an event.id
When I use Download ical button, on a page that has multiple "add to calendar" widgets, the UID that is being generated is
UID:-https://www.mywebsite.com
So all the events on that page - will have the same UID, and that is causing each ics download to override the previous events that were added to my calendar.
When I examined this, I found out that generateCalendars() was called without an event.id
This PR fixing that issue, and now the UID includes the random ID added before the url -
UID:624696-https://www.mywebsite.com
I'd suggest adding this to sanitizeParams instead, in the if statement that sets params.options.id if it is not set. Then the event object will have an id param. As originally designed I'm not even sure why the id gets added to params.options instead of the params.data object.
params.data.id = params.options.id;