Skip to content

Commit 4cf5eb9

Browse files
committedJan 16, 2019
Only validate choice field if is not empty and if is not a valid choice
1 parent 81e0717 commit 4cf5eb9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎src/Fields/ChoiceField.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function validate($value)
4141
{
4242
parent::validate($value);
4343

44-
if (!$this->validValue($value)) {
44+
if (!$this->isEmpty($value) && !$this->validValue($value)) {
4545
if (is_array($value)) {
4646
$value_diff = array_diff($value, array_keys($this->choices));
4747
$value = implode(', ', $value_diff);

0 commit comments

Comments
 (0)
Please sign in to comment.