使用FOSUserBundle创建新用户失败 [英] Creating a new user with FOSUserBundle fails
本文介绍了使用FOSUserBundle创建新用户失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试从命令行创建新用户并收到此错误:
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
当尝试通过Web界面注册来创建用户时,我得到以下信息:
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.
我在非常简单的设置中使用v 1.3.1,尚未找到任何解决方案.
I am using v 1.3.1 in a very plain setup and haven't found any solution yet.
有什么想法吗?
推荐答案
已修复!
我的User实体中有一个自定义的构造方法.我忘了用parent::__construct();
I had a custom constructor method in my User entity. There I had forgotten to call the parent's constructor with parent::__construct();
这篇关于使用FOSUserBundle创建新用户失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文