dongzhao2725
2019-04-24 07:42
浏览 98
已采纳

Symfony 3 - 注意:unserialize():偏移量为11个字节的错误

I do not understand, I work under Symfony 3 and I just got an error when I want to go to my user administration page:

Notice: unserialize(): Error at offset 11 of 28 bytes

Symfony\Component\Debug\Exception\ ContextErrorException

in vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/ArrayType.php (line 58)

However, before it worked very well, it's very strange. Several other people have already had the same problem but it is never the same cause.

I remember doing a little emptiness in my useless files of my project but I deleted that which was unused, and the commented blocks which I did not use.

If it helps to solve my problem, here is my user.php

Thanks !

EDIT : Ok I'm just very stupid. My User entity inherits from FOSUserBundle. In my database, I had a User who had the role SUPER_ADMIN. Suaf meanwhile, in my code, I deleted this role to leave only the role ADMIN, and I modified myself in the database by removing the "SUPER" too much. I did not think it would make this kind of bug, if anyone can explain to me why, for my culture.

But in any case the problem is still solved!

图片转代码服务由CSDN问答提供 功能建议

我不明白,我在Symfony 3下工作,当我想转到我的用户时,我遇到了一个错误 管理页面:

注意:unserialize():偏移11错误28字节

Symfony \ Component \ Debug \ Exception / ContextErrorException

  in vendor / doctrine / dbal / lib / Doctrine / DBAL / Types / ArrayType.php(第58行)
    
 
 

然而,在它运作良好之前,它非常奇怪。 其他几个人已经遇到了同样的问题,但原因从来都不一样。

我记得在我的项目无用的文件中做了一点空虚,但我删除了那些未使用过的文件, 我没有使用的注释块。

如果它有助于解决我的问题,这是我的user.php

谢谢!

编辑:好的,我只是非常愚蠢。 我的用户实体继承自FOSUserBundle。 在我的数据库中,我有一个具有SUPER_ADMIN角色的用户。 同时,在我的代码中,我删除了这个角色,只留下了ADMIN角色,我通过删除“SUPER”来修改自己在数据库中。 我不认为它会产生这种错误,如果有人能解释为什么,为了我的文化。

但无论如何问题仍然解决了! \ n

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

1条回答 默认 最新

相关推荐 更多相似问题