Skip to content

Commit

Permalink
MDL-46696 backup: Handle older backups not containing grade history
Browse files Browse the repository at this point in the history
  • Loading branch information
Frederic Massart committed Sep 9, 2014
1 parent eb80a14 commit f1272bb
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions backup/moodle2/restore_stepslib.php
Original file line number Diff line number Diff line change
Expand Up @@ -3035,6 +3035,18 @@ public function after_restore() {
*/
class restore_activity_grade_history_structure_step extends restore_structure_step {

/**
* This step is executed only if the grade history file is present.
*/
protected function execute_condition() {
$fullpath = $this->task->get_taskbasepath();
$fullpath = rtrim($fullpath, '/') . '/' . $this->filename;
if (!file_exists($fullpath)) {
return false;
}
return true;
}

protected function define_structure() {
$paths = array();

Expand Down

0 comments on commit f1272bb

Please sign in to comment.