From 10d7dac52813068963ea852483d00380abe4819d Mon Sep 17 00:00:00 2001 From: David Mudrak Date: Thu, 26 Jan 2012 14:09:04 +0100 Subject: [PATCH] MDL-31317 original_site_identifier_hash falls back to null during the backup conversion Even if the site identifier is not defined in the source 1.9 backup then the converted 2.0 version should still contain the element to prevent PHP notices on direct assignment. --- backup/converter/moodle1/handlerlib.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/backup/converter/moodle1/handlerlib.php b/backup/converter/moodle1/handlerlib.php index a6b77886b99..f0c97541ca9 100644 --- a/backup/converter/moodle1/handlerlib.php +++ b/backup/converter/moodle1/handlerlib.php @@ -345,6 +345,8 @@ class moodle1_root_handler extends moodle1_xml_handler { // {@see backup_general_helper::backup_is_samesite()} if (isset($backupinfo['original_site_identifier_hash'])) { $this->xmlwriter->full_tag('original_site_identifier_hash', $backupinfo['original_site_identifier_hash']); + } else { + $this->xmlwriter->full_tag('original_site_identifier_hash', null); } $this->xmlwriter->full_tag('original_course_id', $originalcourseinfo['original_course_id']); $this->xmlwriter->full_tag('original_course_fullname', $originalcourseinfo['original_course_fullname']);