-
Bug
-
Resolution: Unresolved
-
Minor
-
None
-
4.4.1
-
MOODLE_404_STABLE
When a Google Calendar is linked to a Moodle Calendar using an iCal URL, changing an event's description to empty in Google Calendar does not update the event description in Moodle if it already contains text.
Recreation:
- Link a Google Calendar to your Moodle Calendar
- Set the "Event Type" to "Site Wide"
- Create an event in the linked Google Calendar with a description
- Update the Moodle Calendar by going to Calendar > Manage Subscriptions and change the interval in which the calendar is updated to any option
- Check the event appears in the Moodle Calendar
- Now delete the event description in Google Calendar and click "Save"
- Update the Moodle Calendar again
- Go back to the Moodle Calendar - The description remains unchanged
Possible location of issue:
./calendar/lib.php in function calendar_add_icalendar_event line 3008
$result = array_diff((array) $eventrecord, (array) $updaterecord);
In PHP documentation: "Compares array against one or more other arrays and returns the values in array that are not present in any of the other arrays"
If $eventrecord->description = "Description of event"
And $updaterecord->description = ""
Then $result->description = "Description of event"
When it should be $result->description = ""