Skip to content

Commit 95ab786

Browse files
[Debug] check that date field exists in data before trying to modify its format
1 parent 2464e6b commit 95ab786

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Form/Field/FieldBuilder.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ public function alterDataPreSetDataEvent($formFields, $builder)
132132
}
133133
}
134134
}
135-
} elseif ("date" == $field->type) {
135+
} elseif ("date" == $field->type && array_key_exists($name, $formData)) {
136136
$dateTimeValue = \DateTime::createFromFormat('Y-m-d H:i:s.u', $formData[$name]['date']);
137137
// try to get the date without milliseconds
138138
if (!$dateTimeValue) {

0 commit comments

Comments
 (0)