我的项目几乎一切正常,除了当我以数据库(FOSUserBundle)中没有通信的用户登录(使用facebook)时,我被重定向到/registration/{id},却得到了一个错误:
The form's view data is expected to be an instance of class Naroga\Reader\CommonBundle\Entity\User, but is an instance of class HWI\Bundle\OAuthBundle\OAuth\Response\PathUserResponse. You can avoid this error by setting the "data_class" option to null or by adding a view transformer that transforms an instance of class HWI\Bundle\OAuthBundle\OAuth\Response\PathUserResponse to an instance of Naroga\Reader\CommonBundle\Entity\User.
我还必须重写connect.confirm.html.twig来删除以下行:
{% if userInformation.profilePicture is not empty %}
<img src="{{ userInformation.profilePicture }}" />
{% endif %}它说PathUserResponse没有profilePicture方法。我的猜测是我不应该使用PathUserResponse,但我不知道我做错了什么。谁能给我指个方向?
发布于 2013-04-12 21:59:58
HWI/OAuth-Bundle的好心人已经解决了这个问题。我认为我做错了什么,但这些实际上是已知的bug。
https://stackoverflow.com/questions/15441001
复制相似问题