MDL-61526 Questions: Fix creation of multiple TOP question categories

Backup files that are made from Moodle 3.5 already contain TOP categories.
There is no need to create an additional TOP category for them.
This commit is contained in:
Shamim Rezaie 2018-02-28 01:31:20 +11:00
parent 856e07e4e7
commit 0f80f793df

View File

@ -4409,8 +4409,7 @@ class restore_create_categories_and_questions extends restore_structure_step {
if ($backuprelease < 3.5 || $backupbuild < 20180205) {
$before35 = true;
}
if (empty($mapping->info->parent) &&
($before35 || $mapping->info->contextlevel == CONTEXT_MODULE)) {
if (empty($mapping->info->parent) && $before35) {
$top = question_get_top_category($data->contextid, true);
$data->parent = $top->id;
}