EasyCorp / EasyAdminBundle

EasyAdmin is a fast, beautiful and modern admin generator for Symfony applications.
MIT License
3.99k stars 1.01k forks source link

Fix nullable detection #6276

Open DrWarpMan opened 3 weeks ago

DrWarpMan commented 3 weeks ago

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:

References: Doctrine 3.x $nullable How Doctrine determines nullable