-
Bug
-
Resolution: Duplicate
-
Minor
-
None
-
3.9.10
-
None
-
MOODLE_39_STABLE
Saving the calendar event to the database seems to include all of the inactive form elements aswell, so the values get overwritten, which results in an error on every page that tries to access a broken event.
Steps to reproduce:
Create a course and enrol yourself in it. Create a group inside the course with yourself as a member. Go to your calendar page and add a calendar event of the Group type with the previously created group in the course. Open the event for editing and remove the selected course, keeping the group set. Switch the event type to User and save the event. An error modal should pop up, containing the Invalidrecord error message. The error is from recieving the data, in the database, courseid has been set to 0 while groupid is still set:
MariaDB [moodle]> select name,categoryid,courseid,groupid,userid,type from mdl_event where userid=2; |
+--------------------------+------------+----------+---------+--------+------+
|
| name | categoryid | courseid | groupid | userid | type |
|
+--------------------------+------------+----------+---------+--------+------+
|
| errorevent | 0 | 0 | 3 | 2 | 0 | |
+--------------------------+------------+----------+---------+--------+------+
|
At this point, the event will disappear from the calendar as if it was deleted. If the surprised user decides to add another event with the same name (in this case - "errorevent"), Moodle will add the event, but every time it tries to fetch it from the database, it will grab the first one. As the record contains a valid groupid but not courseid, Moodle will return an error on every calendar instance that would include the event to all members of the group, preventing them from viewing their calendars.
- is duplicated by
-
MDL-62959 Changing a course event to a user event results in an error
-
- Closed
-