dpafea04148 2014-12-08 09:31
浏览 28

Symfony2 MongoDB表单验证程序不加载DocumentManager

I work actually on a symfony2 project with MongoDB but I'm faced to a strange problem, when I want to submit some data in a form, symfony do a validation of these data but it loads an EntityManager so it tries to connect to a SQL server, obviously I got an error:

An exception occured in driver: SQLSTATE[28000] [1045] Blah Blah ... 

The correct data_class is loaded for each form (example: My\Project\UserBundle\Document\User) so logicaly it will use the correct ObjectManager so DocumentManager for MongoDB but no...

The project I'm working on is separated on 3 web applications but work with the same database and have to manage MongoDB and others who orm can work with. So we have in dependencies a library which manages entities or documents with services/managers/etc.. like FosUserBundle for example. And this problem came when we implemented the library.

I tried different things if it was the namespace or because the document was in vendor so I inherited documents in children bundle but still the same problem.

Notice: Even FosUserBundle forms doesn't work anymore except the login (but it's symfony security part)

I don't have much code to share since I have totally no idea where is come from.

There is a way to force the ObjectManager to a form ? Or something else ?

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 微信公众平台自制会员卡可以通过收款码收款码收款进行自动积分吗
    • ¥15 随身WiFi网络灯亮但是没有网络,如何解决?
    • ¥15 gdf格式的脑电数据如何处理matlab
    • ¥20 重新写的代码替换了之后运行hbuliderx就这样了
    • ¥100 监控抖音用户作品更新可以微信公众号提醒
    • ¥15 UE5 如何可以不渲染HDRIBackdrop背景
    • ¥70 2048小游戏毕设项目
    • ¥20 mysql架构,按照姓名分表
    • ¥15 MATLAB实现区间[a,b]上的Gauss-Legendre积分
    • ¥15 delphi webbrowser组件网页下拉菜单自动选择问题