MDL-46696 backup: Handle older backups not containing grade history

This commit is contained in:
Frederic Massart 2014-09-09 10:21:16 +08:00
parent eb80a145c8
commit f1272bbecd

View File

@ -3035,6 +3035,18 @@ class restore_activity_grades_structure_step extends restore_structure_step {
*/
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();