Skip to content

Commit

Permalink
Merged branch '1.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
alongosz committed Oct 6, 2020
2 parents 1237abf + 0c0819d commit 2775467
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/lib/Validator/Constraints/FieldValueValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
use eZ\Publish\Core\FieldType\ValidationError;
use eZ\Publish\SPI\FieldType\Value;
use EzSystems\EzPlatformContentForms\Data\Content\FieldData;
use Symfony\Component\Validator\Util\PropertyPath;
use Symfony\Component\Validator\Constraint;
use Symfony\Component\Validator\Util\PropertyPath;

/**
* Base class for field value validators.
Expand Down Expand Up @@ -89,6 +89,10 @@ protected function getFieldTypeIdentifier(ValueObject $value): string

protected function generatePropertyPath($errorIndex, $errorTarget): string
{
return PropertyPath::append('value', $errorTarget);
$basePath = 'value';

return $errorTarget === null
? $basePath
: PropertyPath::append($basePath, $errorTarget);
}
}

0 comments on commit 2775467

Please sign in to comment.