Skip to content

Commit

Permalink
MDL-61526 Questions: Fix creation of multiple TOP question categories
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
rezaies committed Mar 5, 2018
1 parent 856e07e commit 0f80f79
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions backup/moodle2/restore_stepslib.php
Expand Up @@ -4409,8 +4409,7 @@ protected function process_question_category($data) {
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;
}
Expand Down

0 comments on commit 0f80f79

Please sign in to comment.