Commuity,
i use the FosUserBundle and i have a problem with the username.
On my page, you only need a email and a password. => you could use a username! (because that, i couldnt override the setEmail() function in entity with setUsername($email) ^^
If i use this in my configuration, i get the following error.
fos_user:
registration:
form:
validation_groups: [AppRegistration]
Error:
SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'username' cannot be null
What can i do?
Thank you in Advance!
setEmail($email)
to also set username in your User-class. This might be redundant, but makes makes sure that each stuff requiring a username still works, e.g. login via username+password. Of course you also have to change the signup form accordingly, so that users don't choose a username other than their email-address, also you might want to change the translation to say email instead of username. – dbrumann