From 84dcdbdb583e699c28c0a25c1a2d3c9c90896c1a Mon Sep 17 00:00:00 2001 From: Eloy Lafuente Date: Tue, 5 Oct 2010 08:21:57 +0000 Subject: [PATCH] MDL-24470 data->notification - apply correct default if null is found on restore --- mod/data/backup/moodle2/restore_data_stepslib.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mod/data/backup/moodle2/restore_data_stepslib.php b/mod/data/backup/moodle2/restore_data_stepslib.php index b89955cdc91..15af06a9ad5 100644 --- a/mod/data/backup/moodle2/restore_data_stepslib.php +++ b/mod/data/backup/moodle2/restore_data_stepslib.php @@ -66,6 +66,12 @@ class restore_data_activity_structure_step extends restore_activity_structure_st $data->scale = -($this->get_mappingid('scale', abs($data->scale))); } + // Some old backups can arrive with data->notification = null (MDL-24470) + // convert them to proper column default (zero) + if (is_null($data->notification)) { + $data->notification = 0; + } + // insert the data record $newitemid = $DB->insert_record('data', $data); $this->apply_activity_instance($newitemid); -- 2.43.0