Closed tacman closed 11 months ago
I recently added
#[Assert\EnableAutoMapping]
to a class that implements TranslatableInterface, but now when I try to validate an entity, I get
object(App\Entity\Project).translations: This value should not be null. (code ad32d13f-c3d4-423b-909a-857b961eb720)
I can't find where translations is being set to NotNull, though I suspect it's in Defaults.
bin/console debug:valid App\Entity\Project
|translations | Symfony\Component\Validator\Constraints\NotNull | Default, Project | [ | | | | | "message" => "This value should not be null.", | | | | | "payload" => null | | | | | ]
I think null is valid, and I can't figure out how to unset this, or even how to set it to an acceptable default (an empty collection?)
The same thing is happening with currentLocale, even though that's not persisted.
I think I'm going down the wrong path here, so I'm closing this.
I recently added
to a class that implements TranslatableInterface, but now when I try to validate an entity, I get
I can't find where translations is being set to NotNull, though I suspect it's in Defaults.
bin/console debug:valid App\Entity\Project
|translations | Symfony\Component\Validator\Constraints\NotNull | Default, Project | [ | | | | | "message" => "This value should not be null.", | | | | | "payload" => null | | | | | ]
I think null is valid, and I can't figure out how to unset this, or even how to set it to an acceptable default (an empty collection?)