Permalink
Browse files

Merge branch 'master_MDL-37714' of git://github.com/greg-or/moodle

  • Loading branch information...
2 parents 8621a0e + 20c9f4a commit 4f31798dfcde638578fced53e8553676af261568 @stronk7 stronk7 committed Feb 3, 2014
View
2 grade/grading/form/guide/backup/moodle2/backup_gradingform_guide_plugin.class.php
@@ -65,7 +65,7 @@ protected function define_definition_plugin_structure() {
$pluginwrapper->add_child($criteria);
$criteria->add_child($criterion);
- $criteria->add_child($comments);
+ $pluginwrapper->add_child($comments);
$comments->add_child($comment);
// Set sources to populate the data.
View
19 grade/grading/form/guide/backup/moodle2/restore_gradingform_guide_plugin.class.php
@@ -48,6 +48,11 @@ protected function define_definition_plugin_structure() {
$paths[] = new restore_path_element('gradingform_guide_comment',
$this->get_pathfor('/guidecomments/guidecomment'));
+ // MDL-37714: Correctly locate frequent used comments in both the
+ // current and incorrect old format.
+ $paths[] = new restore_path_element('gradingform_guide_comment_legacy',
+ $this->get_pathfor('/guidecriteria/guidecomments/guidecomment'));
+
return $paths;
}
@@ -100,6 +105,20 @@ public function process_gradingform_guide_comment($data) {
}
/**
+ * Processes comments element data
+ *
+ * @param array|stdClass $data The data to insert as a comment
+ */
+ public function process_gradingform_guide_comment_legacy($data) {
+ global $DB;
+
+ $data = (object)$data;
+ $data->definitionid = $this->get_new_parentid('grading_definition');
+
+ $DB->insert_record('gradingform_guide_comments', $data);
+ }
+
+ /**
* Processes filling element data
*
* @param array|stdClass $data The data to insert as a filling

0 comments on commit 4f31798

Please sign in to comment.