-
Bug
-
Resolution: Cannot Reproduce
-
Minor
-
None
-
3.5.7
-
None
-
MOODLE_35_STABLE
cron.php returns error:
Adhoc task failed: core_course\task\course_delete_modules,Coding error detected, it must be fixed by a programmer: The course module XXX could not be deleted.
The error appears when the course recycle bin is enabled.
The first issue appears in bigbluebutonbn because of lack of returned value in bigbluebuttonbn_delete_instance_log() in mod/bigbluebuttonbn/lib.php.
function bigbluebuttonbn_delete_instance_log($bigbluebuttonbn)
{ global $DB; $sql = "SELECT * FROM \{bigbluebuttonbn_logs} ";
$sql .= "WHERE bigbluebuttonbnid = ? AND log = ? AND ". $DB->sql_compare_text('meta') . " = ?";
$logs = $DB->get_records_sql($sql, array($bigbluebuttonbn->id, BIGBLUEBUTTONBN_LOG_EVENT_CREATE, "{\"record\":true}"));
$meta = "{\"has_recordings\":" . empty($logs) ? "true" : "false" . "}";
return bigbluebuttonbn_log($bigbluebuttonbn, BIGBLUEBUTTONBN_LOG_EVENT_DELETE, [], $meta);//!!!!!!!!!!
}
'Return' should be added to prevent the issue in course_delete_module() in course/lib.php:
...
//bigbluebuttonbn_delete_instance()
if (!$deleteinstancefunction($cm->instance)) {
throw new moodle_exception('cannotdeletemoduleinstance', {{, }}, null,
"Cannot delete the module $modulename (instance).");
}
...
If the issue appeared once it cause the repeated issue in the cron.
In DB it looks like:
- No record in mdl_bigbluebuttonbn,
- Kept record in mdl_course_modules
- is blocked by
-
CONTRIB-7994 Improving the way we deal with synchronisation of entities between Moodle and BigBlueButton
-
- Closed
-