Skip to content
Snippets Groups Projects
Commit e02a2521 authored by Michael Stenta's avatar Michael Stenta Committed by Jonathan Sacksick
Browse files

Issue #3396186 by m.stenta: State constraint is not validated on new entities.

parent a6be4084
No related branches found
No related tags found
1 merge request!26Draft: Automated Project Update Bot fixes
Pipeline #54885 canceled
......@@ -16,7 +16,7 @@ class StateConstraintValidator extends ConstraintValidator {
* {@inheritdoc}
*/
public function validate($value, Constraint $constraint) {
if (!$value->getEntity()->isNew() && !$value->isValid()) {
if (!$value->isValid()) {
$this->context->addViolation($constraint->message, ['@state' => $value->value]);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment