From d09fffbefbfead919d6d125232159dec63ffde8d Mon Sep 17 00:00:00 2001 From: Paul Nicholls Date: Wed, 7 Nov 2012 14:06:03 +1300 Subject: [PATCH] MDL-32880: Add moodle1 backup converter for rss_client block. Creates a shell rss_client.xml file, which contains no feeds. This makes it behave the same as restoring a Moodle 1.9 backup into a different 1.9 site - the block is created, its title is as per the original course, but it has no feeds selected (and none are added to the site's feed list). --- blocks/rss_client/backup/moodle1/lib.php | 34 ++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 blocks/rss_client/backup/moodle1/lib.php diff --git a/blocks/rss_client/backup/moodle1/lib.php b/blocks/rss_client/backup/moodle1/lib.php new file mode 100644 index 00000000000..95da634ac0a --- /dev/null +++ b/blocks/rss_client/backup/moodle1/lib.php @@ -0,0 +1,34 @@ +converter->get_contextid(CONTEXT_BLOCK, $data['id']); + + // Moodle 1.9 backups do not include sufficient data to restore feeds, so we need an empty shell rss_client.xml + // for the restore process to find + $this->open_xml_writer("course/blocks/{$data['name']}_{$instanceid}/rss_client.xml"); + $this->xmlwriter->begin_tag('block', array('id' => $instanceid, 'contextid' => $contextid, 'blockname' => 'rss_client')); + $this->xmlwriter->begin_tag('rss_client', array('id' => $instanceid)); + $this->xmlwriter->full_tag('feeds', ''); + $this->xmlwriter->end_tag('rss_client'); + $this->xmlwriter->end_tag('block'); + $this->close_xml_writer(); + + return $data; + } +} \ No newline at end of file