Closed OdyX closed 3 years ago
When resetting mod_opencast instances through the API, sometimes this error can occur:
mod_opencast
Unknown column 'timeopen' in 'where clause' UPDATE mdl_opencast SET timeopen = timeopen + ? WHERE course=? AND timeopen<>0 [array ( 0 => 3600, 1 => 3311, )]
This is because this line will ask Moodle to update fields that don't exist: https://github.com/ndunand/moodle-mod_opencast/blob/master/lib.php#L225
// updating dates - shift may be negative too if ($data->timeshift) { shift_course_mod_dates('opencast', ['timeopen', 'timeclose'], $data->timeshift, $data->courseid); $status[] = ['component' => $componentstr, 'item' => get_string('datechanged'), 'error' => false]; }
My proposal is to completely remove all references to these fields that are not installed in the DB (not present in db/install.xml).
db/install.xml
Thanks for spotting this and for providing a fix!
When resetting
mod_opencast
instances through the API, sometimes this error can occur:This is because this line will ask Moodle to update fields that don't exist: https://github.com/ndunand/moodle-mod_opencast/blob/master/lib.php#L225
My proposal is to completely remove all references to these fields that are not installed in the DB (not present in
db/install.xml
).