MDL-52523 backup of subplugins: add missing global

This commit is contained in:
Tim Hunt 2015-12-15 15:57:23 +00:00
parent 0dfcc2541a
commit 8eef9244be
2 changed files with 8 additions and 0 deletions

View File

@ -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) {

View File

@ -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) {