In Symfony production environment, since Doctrine 3.x, cached values for 'nullable' property can be either null, false or true. In Doctrine 2.x, it's only false or true. When Doctrine returns null for the nullable property, the required option for the field is set to false.
While in fact, Doctrine considers nullable => null as nullable => false, thus the field should be required.
To reproduce:
create an entity, with a field that has 'nullable' property set to false
create an admin controller for the entity (make sure to NOT set setRequired(true) explicitly)
try to create a new record in the dashboard, you will see that the field is optional
In Symfony production environment, since Doctrine 3.x, cached values for 'nullable' property can be either
null
,false
ortrue
. In Doctrine 2.x, it's onlyfalse
ortrue
. When Doctrine returnsnull
for the nullable property, the required option for the field is set tofalse
.While in fact, Doctrine considers
nullable => null
asnullable => false
, thus the field should be required.To reproduce:
false
setRequired(true)
explicitly)References: Doctrine 3.x $nullable How Doctrine determines nullable