EasyAdminBundle
EasyAdminBundle copied to clipboard
AssociationField with autocomplete enabled does not save empty values for associations with fetch=EAGER flag
Describe the bug AssociationField with autocomplete enabled does not save empty values for associations with fetch=EAGER flag
To Reproduce EasyAdmin v4.24.5
- Create entity with some association having fetch="EAGER" flag, e.g:
#[ManyToOne(cascade: ['persist'], fetch: 'EAGER'), JoinColumn(onDelete: 'SET NULL', nullable: true)]
private ?Image $logo = null;
- Create non-required autocomplete Association field in your crud controller:
yield AssociationField::new('logo', 'Logo')
->setRequired(false)
->autocomplete();
- Open an Crud::PAGE_EDIT form where the association is already filled with a non-null value.
- Erase value of the corresponding field and click Submit
Expected result: The corresponding field now has a value of NULL.
Observed result: The value of the corresponding field does not change.