Merge branch 'MDL-62388_master' of git://github.com/dmonllao/moodle
[moodle.git] / admin / tool / dataprivacy / classes / api.php
index d1d6ef4..9054612 100644 (file)
@@ -478,6 +478,10 @@ class api {
     public static function update_purpose(stdClass $record) {
         self::check_can_manage_data_registry();
 
+        if (!isset($record->sensitivedatareasons)) {
+            $record->sensitivedatareasons = '';
+        }
+
         $purpose = new purpose($record->id);
         $purpose->from_record($record);