-
Bug
-
Resolution: Unresolved
-
Minor
-
None
-
2.7.4
-
None
-
turnitintool 2013111403
-
MOODLE_27_STABLE
Some users were getting this error on login:
"Can not find data record in database table course_modules."
The more detailed version of this is:
Debug info: SELECT * FROM
{course_modules} WHERE id = ?
[array (
0 => false,
)]
Error code: invalidrecord
Stack trace: ◦line 1451 of /lib/dml/moodle_database.php: dml_missing_record_exception thrown
◦line 1427 of /lib/dml/moodle_database.php: call to moodle_database->get_record_select()
◦line 160 of /availability/classes/info_module.php: call to moodle_database->get_record()
◦line 456 of /calendar/renderer.php: call to core_availability\info_module::is_user_visible()
◦line 133 of /calendar/view.php: call to core_calendar_renderer->show_month_detailed()
Actually this was occurring on the frontpage. It was "resolved" initially by hiding the calendar block on the front page.
I then had a look at the code on a staging site and patched calendar/lib.php:
{{// Set event course class for course events
if (!empty($events)) {
foreach ($events as $eventid => $event) {
if (!empty($event->modulename)) {
try
{
$cm = get_coursemodule_from_instance($event->modulename, $event->instance);
if (!\core_availability\info_module::is_user_visible($cm, 0, false))
{ unset($events[$eventid]); } }
catch(Exception $e)
}
}
}
}}
Note this may be related to more than just turnitin. The important point is that the variable $cm was empty (or contained '').
On the live site I have now included this code but commented out the line which echoes the details.
The component box will not simply let me type calendar. Also we are using 2.7.1 but I was not allowed to select that either.
I may be allowed time to look into this further. If so I will attempt to report what I find here.