From 09c5de5075dbfa6a1d549d6f2cd88eefb5759cdc Mon Sep 17 00:00:00 2001 From: Adrian Greeve Date: Fri, 13 Sep 2013 15:26:13 +0800 Subject: [PATCH] MDL-41772 - mod_data: Fixed database_module comments not being restored. --- .../moodle2/restore_data_activity_task.class.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/mod/data/backup/moodle2/restore_data_activity_task.class.php b/mod/data/backup/moodle2/restore_data_activity_task.class.php index 3896158189b..b444f68fc39 100644 --- a/mod/data/backup/moodle2/restore_data_activity_task.class.php +++ b/mod/data/backup/moodle2/restore_data_activity_task.class.php @@ -120,4 +120,19 @@ class restore_data_activity_task extends restore_activity_task { return $rules; } + + /** + * Given a commment area, return the itemname that contains the itemid mappings. + * + * @param string $commentarea Comment area name e.g. database_entry. + * @return string name of the mapping used to determine the itemid. + */ + public function get_comment_mapping_itemname($commentarea) { + if ($commentarea == 'database_entry') { + $itemname = 'data_record'; + } else { + $itemname = parent::get_comment_mapping_itemname($commentarea); + } + return $itemname; + } }