Browse Source

Fix problems on backup/restore

MOODLE_20_STABLE
bdaloukas 8 years ago
parent
commit
654f6fb342
  1. 9
      backup/moodle2/restore_game_stepslib.php
  2. 2
      version.php

9
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->timemodified = $this->apply_date_offset($data->timemodified);
$data->quizid = $this->get_mappingid('quiz', $data->quizid); $data->quizid = $this->get_mappingid('quiz', $data->quizid);
$data->glossaryid = $this->get_mappingid('glossary', $data->glossaryid); $data->glossaryid = $this->get_mappingid('glossary', $data->glossaryid);
$data->glossarycategoryid = $this->get_mappingid('glossary_categories', $data->glossarycategoryid); $data->glossarycategoryid = $this->get_mappingid('glossary_category', $data->glossarycategoryid);
$data->questioncategoryid = $this->get_mappingid('question_categories', $data->questioncategoryid); $data->questioncategoryid = $this->get_mappingid('question_category', $data->questioncategoryid);
$data->bookid = $this->get_mappingid('book', $data->bookid); $data->bookid = $this->get_mappingid('book', $data->bookid);
$data->glossaryid2 = $this->get_mappingid('glossary', $data->glossaryid2); $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. // Insert the game record.
$newitemid = $DB->insert_record('game', $data); $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->gameid = $this->get_new_parentid('game');
$data->chapterid = $this->get_mappingid('book_chapters', $data->chapterid); $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); $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 = (object)$data;
$data->id = $this->get_new_parentid('game_attempt'); $data->id = $this->get_new_parentid('game_attempt');
$data->queryid = $this->get_mappingid('game_queries', $data->queryid);
game_insert_record( 'game_sudoku', $data); game_insert_record( 'game_sudoku', $data);
} }

2
version.php

@ -35,7 +35,7 @@ if (!isset( $plugin)) {
} }
$plugin->component = 'mod_game'; // Full name of the plugin (used for diagnostics). $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->requires = 2010112400; // Requires Moodle 2.0.
$plugin->cron = 0; // Period for cron to check this module (secs). $plugin->cron = 0; // Period for cron to check this module (secs).
$plugin->release = '2017-07-06'; $plugin->release = '2017-07-06';

Loading…
Cancel
Save