MDL-49748 mod_data: update fields even when empty

This commit is contained in:
Alex Mitin 2015-04-03 17:34:49 +08:00 committed by John Okely
parent d7551257a0
commit 23464633c8

View File

@ -3836,11 +3836,9 @@ function data_process_submission(stdClass $mod, $fields, stdClass $datarecord) {
$requiredfieldsfilled = false;
}
if ($fieldhascontent) {
// The field has content so it should be updatable.
foreach ($submitteddata[$fieldrecord->id] as $value) {
$result->fields[$value->fieldname] = $field;
}
// Update the field.
foreach ($submitteddata[$fieldrecord->id] as $value) {
$result->fields[$value->fieldname] = $field;
}
}