mirror of
https://github.com/moodle/moodle.git
synced 2025-08-06 17:36:38 +02:00
Merge branch 'master_MDL-71696-versioning-integration' of https://github.com/catalyst/moodle-MDL-70329
This commit is contained in:
commit
b841a811be
223 changed files with 7768 additions and 2899 deletions
|
@ -1064,14 +1064,14 @@ function course_delete_module($cmid, $async = false) {
|
|||
}
|
||||
}
|
||||
|
||||
question_delete_activity($cm);
|
||||
|
||||
// Call the delete_instance function, if it returns false throw an exception.
|
||||
if (!$deleteinstancefunction($cm->instance)) {
|
||||
throw new moodle_exception('cannotdeletemoduleinstance', '', '', null,
|
||||
"Cannot delete the module $modulename (instance).");
|
||||
}
|
||||
|
||||
question_delete_activity($cm);
|
||||
|
||||
// Remove all module files in case modules forget to do that.
|
||||
$fs = get_file_storage();
|
||||
$fs->delete_area_files($modcontext->id);
|
||||
|
|
|
@ -1706,8 +1706,13 @@ class core_course_courselib_testcase extends advanced_testcase {
|
|||
$this->assertEquals(0, $DB->count_records('question_categories', $criteria));
|
||||
|
||||
// Verify questions deleted.
|
||||
$criteria = array('category' => $qcat->id);
|
||||
$this->assertEquals(0, $DB->count_records('question', $criteria));
|
||||
$criteria = [$qcat->id];
|
||||
$sql = 'SELECT COUNT(q.id)
|
||||
FROM {question} q
|
||||
JOIN {question_versions} qv ON qv.questionid = q.id
|
||||
JOIN {question_bank_entries} qbe ON qbe.id = qv.questionbankentryid
|
||||
WHERE qbe.questioncategoryid = ?';
|
||||
$this->assertEquals(0, $DB->count_records_sql($sql, $criteria));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue