Details
-
Bug
-
Status: Closed
-
Blocker
-
Resolution: Fixed
-
2.0.3, 2.1
-
MOODLE_20_STABLE, MOODLE_21_STABLE
-
MOODLE_20_STABLE
-
MDL-27906_HEAD -
Description
While reviewing MDL-27490 it has been found one regression introduced by MDL-26516.
It affects master and 20_STABLE. To reproduce:
edit one quiz with (user) overrides enabled and press "save and display", it causes:
Debug info: SELECT md.name
|
FROM {modules} md
|
JOIN {course_modules} cm ON cm.module = md.id
|
WHERE cm.id = :cmid
|
[array (
|
'cmid' => '43',
|
)]
|
Stack trace:
|
line 1282 of /lib/dml/moodle_database.php: dml_missing_record_exception thrown
|
line 1354 of /lib/dml/moodle_database.php: call to moodle_database->get_record_sql()
|
line 1340 of /lib/datalib.php: call to moodle_database->get_field_sql()
|
line 1890 of /calendar/lib.php: call to get_coursemodule_from_id()
|
line 1815 of /calendar/lib.php: call to calendar_event->calculate_context()
|
line 2382 of /calendar/lib.php: call to calendar_event->__construct()
|
line 1153 of /mod/quiz/lib.php: call to calendar_event::create()
|
line 1040 of /mod/quiz/lib.php: call to quiz_update_events()
|
line 113 of /mod/quiz/lib.php: call to quiz_after_add_or_update()
|
line 328 of /course/modedit.php: call to quiz_update_instance()
|
After tracing the problem down, it seems that there is one incorrect get_coursemodule_from_id() call in calendar/lib.php (line 1890, master). It should be get_coursemodule_from_instance() instead.
Plz, fix it in both branches and check there are not more uses of that along the whole calendar/lib.php
Thanks!
Attachments
Issue Links
- has been marked as being related by
-
MDL-27490 Add a manage question behaviours admin page
-
- Closed
-