diff --git a/backup/util/plan/backup_structure_step.class.php b/backup/util/plan/backup_structure_step.class.php index 5d8cb557573..e18ada4b049 100644 --- a/backup/util/plan/backup_structure_step.class.php +++ b/backup/util/plan/backup_structure_step.class.php @@ -183,6 +183,10 @@ abstract class backup_structure_step extends backup_step { * @return void */ protected function add_subplugin_structure($subplugintype, $element, $multiple, $plugintype = null, $pluginname = null) { + global $CFG; + // This global declaration is required, because where we do require_once($backupfile); + // That file may in turn try to do require_once($CFG->dirroot ...). + // That worked in the past, we should keep it working. // Verify if this is a BC call for an activity backup. See NOTE above for this special case. if ($plugintype === null and $pluginname === null) { diff --git a/backup/util/plan/restore_structure_step.class.php b/backup/util/plan/restore_structure_step.class.php index de7b0029c3a..b59ac82f479 100644 --- a/backup/util/plan/restore_structure_step.class.php +++ b/backup/util/plan/restore_structure_step.class.php @@ -313,6 +313,10 @@ abstract class restore_structure_step extends restore_step { * @return void */ protected function add_subplugin_structure($subplugintype, $element, $plugintype = null, $pluginname = null) { + global $CFG; + // This global declaration is required, because where we do require_once($backupfile); + // That file may in turn try to do require_once($CFG->dirroot ...). + // That worked in the past, we should keep it working. // Verify if this is a BC call for an activity restore. See NOTE above for this special case. if ($plugintype === null and $pluginname === null) {