0

I followed the instructions here to add the SonataUserBundle to my Symfony + Sonata Admin project.

I could create users from the cmd line without a problem, as the article suggests. But from the UserAdmin it's not working and instead gives 3 errors of empty fields (see screenshot). But these fields shouldn't be empty:

  • createdAt should be filled by prePersist,
  • updatedAt should be allowed to be null, since it's part of the Registration group
  • and password should be filled by the SonataUserAdmin prePersist, by hashing plainPassword.

Somehow, the entity prePersist is not called when creating a new User entity. And also the UserAdmin's prePersist is not called. enter image description here

However, editing users is working fine.

Any idea what's going on? Thank you!

Catalin
  • 121
  • 1
  • 9

0 Answers0