Skip to content

Commit

Permalink
Fix restore of comment field in rules
Browse files Browse the repository at this point in the history
  • Loading branch information
dasistwas committed Jun 18, 2024
1 parent 991c15c commit 8fa8af4
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions backup/moodle2/restore_datalynx_stepslib.php
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,16 @@ protected function process_datalynx_rule($data) {
if ($data->param5 && $data->type == 'eventnotification') {
$data->param5 = $this->get_mappingid('datalynx_field', $data->param5);
}

// Update the text comment reference to be sent with the notification.
$param7 = json_decode($data->param7);
if (!empty($param7) && $data->type == 'eventnotification') {
$newparam = [];
foreach ($param7 as $paramid) {
$newparam[] = $this->get_mappingid('datalynx_field', $paramid);
}
$data->param7 = json_encode($newparam);
}

// Insert the datalynx_rules record.
$newitemid = $DB->insert_record('datalynx_rules', $data);
Expand Down

0 comments on commit 8fa8af4

Please sign in to comment.