I am using Symfony 3.0.9 with FosUserBundle to build my app. I recently did a composer update and now I cannot create users via UserManager or command line. The error is Integrity constraint violation: 1048 Column 'salt' cannot be null
. This error occurs even when I explicitly call parent::__construct() in my constructor method as show below:
/**
* constructor.
*/
public function __construct()
{
parent::__construct();
}
And also fails if I called the setSalt method like $user->setSalt('87234hjjdwshjdsjkds')
All efforts to resolve this have failed so I started to pay close attention to my composer update command and this was some of the output:
Updating dependencies (including require-dev)
Removing twig/twig (v1.24.1)
Installing twig/twig (v1.28.2)
Loading from cache
Removing symfony/polyfill-util (v1.2.0)
Installing symfony/polyfill-util (v1.3.0)
Loading from cache
...
Removing symfony/polyfill-intl-icu (v1.2.0)
Installing symfony/polyfill-intl-icu (v1.3.0)
Loading from cache
Removing psr/log (1.0.0)
Installing psr/log (1.0.2)
Loading from cache
Removing doctrine/cache (v1.6.0)
Installing doctrine/cache (v1.6.1)
Loading from cache
...
Removing doctrine/orm (v2.5.4)
Installing doctrine/orm (v2.5.5)
Loading from cache
Removing sensiolabs/security-checker (v3.0.2)
Installing sensiolabs/security-checker (v4.0.0)
Loading from cache
Removing nikic/php-parser (v2.1.0)
Installing nikic/php-parser (v2.1.1)
Loading from cache
...
Removing doctrine/doctrine-migrations-bundle (1.1.1)
Installing doctrine/doctrine-migrations-bundle (v1.2.0)
Loading from cache
...
Removing phpspec/phpspec (2.5.1)
Installing phpspec/phpspec (2.5.5)
Loading from cache
Removing doctrine/data-fixtures (v1.2.1)
Installing doctrine/data-fixtures (v1.2.2)
Loading from cache
Updating friendsofsymfony/user-bundle dev-master (147ca68 => 7261f7a)
Checking out 7261f7aa143b4bfdb0b7ddc5df208067fa7be698
As you can see FOSUSERBUNDLE was updated.
Reverting the composer update, deleting my vendor directory and running composer install fixes it. This summed it down to the update. That was the problem.
If anyone knows how I can update and still have a working application I would be grateful for your comments and feedback.