-
Bug
-
Resolution: Duplicate
-
Minor
-
None
-
3.7.6, 3.8.3, 3.9, 3.10
-
MOODLE_310_STABLE, MOODLE_37_STABLE, MOODLE_38_STABLE, MOODLE_39_STABLE
-
MDL-69033_master -
When the teacher tries to remove a file submission with status "Reopened" the following error is displayed:
Coding error detected, it must be fixed by a programmer: moodle_database::update_record_raw() id field must be specified.
|
That's because removing a submission always tries to remove the latest attempt's files. In this case the latest attempt has no files. There's also no entry in the table `assignsubmission_file` for the latest attempt. This is what's causing the error because Moodle does this with $submissionid being the latest attempt's ID from the table `assign_submission`:
$currentsubmission = $DB->get_record('assignsubmission_file', array('submission'=>$submissionid)); |
$currentsubmission->numfiles = 0; |
$DB->update_record('assignsubmission_file', $currentsubmission); |
Since the entry in `assignsubmission_file` is missing the $DB->get_record call returns false.
- duplicates
-
MDL-67294 Choosing bulk removal of empty submissions causes an error
-
- Closed
-