Creating a new user with FOSUserBundle fails

sprain picture sprain · Jan 11, 2013 · Viewed 14.4k times · Source

I am trying to create a new user from the command line and get this error:

Warning: array_search() expects parameter 2 to be array, null given
in /vendor/friendsofsymfony/user-bundle/FOS/UserBundle/Model/User.php line 368  

When trying to create a user by registering over the webinterface I get this:

SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'salt' cannot be null

Logging in with an already existing user works. Also updating a profile and changing the password. Just creating new users doesn't work.

I am using v 1.3.1 in a very plain setup and haven't found any solution yet.

Any ideas?

Answer

sprain picture sprain · Jan 11, 2013

Fixed!

I had a custom constructor method in my User entity. There I had forgotten to call the parent's constructor with parent::__construct();