Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
EZP-27793: fix updating contectStruct with required value (ezsystems#144
)
  • Loading branch information
wizhippo authored and andrerom committed Aug 28, 2017
1 parent e9b1081 commit 45f31a4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/Validator/Constraints/FieldValueValidator.php
Expand Up @@ -13,6 +13,7 @@
use eZ\Publish\API\Repository\Values\ValueObject;
use eZ\Publish\Core\FieldType\ValidationError;
use EzSystems\RepositoryForms\Data\Content\FieldData;
use EzSystems\RepositoryForms\Data\FieldDefinitionData;
use Symfony\Component\Validator\Constraint;

/**
Expand All @@ -36,7 +37,7 @@ public function validate($value, Constraint $constraint)
$fieldType = $this->fieldTypeService->getFieldType($fieldTypeIdentifier);

$validationErrors = [];
if ($fieldType->isEmptyValue($fieldValue)) {
if (!($value instanceof FieldDefinitionData) && $fieldType->isEmptyValue($fieldValue)) {
if ($fieldDefinition->isRequired) {
$validationErrors = [
new ValidationError(
Expand Down

0 comments on commit 45f31a4

Please sign in to comment.