Reputation: 889
It worked some time ago but now for some reason it produces exception. I have custom User entity and it extends FOS user:
namespace AppBundle\Entity;
use FOS\UserBundle\Model\User as BaseUser;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass="AppBundle\Repository\UserRepository")
* @ORM\Table(name="fos_user")
*/
class User extends BaseUser
{
...
}
There is no setSalt() in my custom class. And as I can see in dumped SQL query other not custom fields (email_canonical, enabled, password, ...) are set properly. What else could I check?
UPDATE
I did composer update. Here is my composer.json
"require": {
"php": ">=5.5.9",
"symfony/symfony": "3.2.*",
"doctrine/orm": "^2.5",
"doctrine/doctrine-bundle": "^1.6",
"doctrine/doctrine-cache-bundle": "^1.2",
"symfony/swiftmailer-bundle": "^2.3",
"symfony/monolog-bundle": "^2.8",
"symfony/polyfill-apcu": "^1.0",
"sensio/distribution-bundle": "^5.0",
"sensio/framework-extra-bundle": "^3.0.2",
"incenteev/composer-parameter-handler": "^2.0",
"friendsofsymfony/user-bundle": "~2.0@dev",
"hwi/oauth-bundle": "^0.5.1",
"twig/extensions": "^1.4"
},
Upvotes: 3
Views: 2363
Reputation: 7606
You must drop your schema and recreate it again. Your salt column should be allowed to be null, because when using the bcryp
algorithm it is indeed null as the salt is directly included in the password (hash). Moreover here is the mapping declaration:
<field name="salt" column="salt" type="string" nullable="true" />
PS: And other advices, updates all bundle, clear the cache, the database and its data...
UPDATE:
Per dMedia, they changed the doctrine mapping in a recent update (Nov 2016)
Upvotes: 8