From 654f6fb342366daf571bff2a4d0f1f42c195c844 Mon Sep 17 00:00:00 2001 From: bdaloukas Date: Thu, 6 Jul 2017 15:49:59 +0300 Subject: [PATCH] Fix problems on backup/restore --- backup/moodle2/restore_game_stepslib.php | 9 ++++----- version.php | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/backup/moodle2/restore_game_stepslib.php b/backup/moodle2/restore_game_stepslib.php index c34bb90..4cde3a9 100644 --- a/backup/moodle2/restore_game_stepslib.php +++ b/backup/moodle2/restore_game_stepslib.php @@ -88,11 +88,11 @@ class restore_game_activity_structure_step extends restore_activity_structure_st $data->timemodified = $this->apply_date_offset($data->timemodified); $data->quizid = $this->get_mappingid('quiz', $data->quizid); $data->glossaryid = $this->get_mappingid('glossary', $data->glossaryid); - $data->glossarycategoryid = $this->get_mappingid('glossary_categories', $data->glossarycategoryid); - $data->questioncategoryid = $this->get_mappingid('question_categories', $data->questioncategoryid); + $data->glossarycategoryid = $this->get_mappingid('glossary_category', $data->glossarycategoryid); + $data->questioncategoryid = $this->get_mappingid('question_category', $data->questioncategoryid); $data->bookid = $this->get_mappingid('book', $data->bookid); $data->glossaryid2 = $this->get_mappingid('glossary', $data->glossaryid2); - $data->glossarycategoryid2 = $this->get_mappingid('glossary_categories', $data->glossarycategoryid2); + $data->glossarycategoryid2 = $this->get_mappingid('glossary_category', $data->glossarycategoryid2); // Insert the game record. $newitemid = $DB->insert_record('game', $data); @@ -271,7 +271,7 @@ class restore_game_activity_structure_step extends restore_activity_structure_st $data->gameid = $this->get_new_parentid('game'); $data->chapterid = $this->get_mappingid('book_chapters', $data->chapterid); - $data->questioncategoryid = $this->get_mappingid('question_categories', $data->questioncategoryid); + $data->questioncategoryid = $this->get_mappingid('question_category', $data->questioncategoryid); $DB->insert_record('game_bookquiz_questions', $data); } @@ -380,7 +380,6 @@ class restore_game_activity_structure_step extends restore_activity_structure_st $data = (object)$data; $data->id = $this->get_new_parentid('game_attempt'); - $data->queryid = $this->get_mappingid('game_queries', $data->queryid); game_insert_record( 'game_sudoku', $data); } diff --git a/version.php b/version.php index 9f9009c..b7cd1ac 100644 --- a/version.php +++ b/version.php @@ -35,7 +35,7 @@ if (!isset( $plugin)) { } $plugin->component = 'mod_game'; // Full name of the plugin (used for diagnostics). -$plugin->version = 2017070602; // The current module version (Date: YYYYMMDDXX). +$plugin->version = 2017070603; // The current module version (Date: YYYYMMDDXX). $plugin->requires = 2010112400; // Requires Moodle 2.0. $plugin->cron = 0; // Period for cron to check this module (secs). $plugin->release = '2017-07-06';