I'm using standard Symfony 4 User entity, created by make:auth and EasyAdmin 2.0.4.
When editing existing User, password field is blank (which is good).
On submitting existing User edit form, when leaving password field blank, I get following error:
Expected argument of type "string", "NULL" given at property path "password".
How to allow EasyAdmin to ignore password field on update, when its value is empty?
Use the empty_data
option to do this. Handle the empty password in your controller.
easy_admin:
entities:
User:
[...]
edit:
- { property: 'password', type: 'text', type_options: { required: false, empty_data: '' } }