From 8eef9244bed13019aab9712213ea9bfa36a047f5 Mon Sep 17 00:00:00 2001 From: Tim Hunt Date: Tue, 15 Dec 2015 15:57:23 +0000 Subject: [PATCH] MDL-52523 backup of subplugins: add missing global --- backup/util/plan/backup_structure_step.class.php | 4 ++++ backup/util/plan/restore_structure_step.class.php | 4 ++++ 2 files changed, 8 insertions(+) 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) { -- 2.43.0