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 fluent的在模拟压强时使用希望得到一些建议
    • ¥15 STM32驱动继电器
    • ¥15 Windows server update services
    • ¥15 关于#c语言#的问题:我现在在做一个墨水屏设计,2.9英寸的小屏怎么换4.2英寸大屏
    • ¥15 模糊pid与pid仿真结果几乎一样
    • ¥15 java的GUI的运用
    • ¥15 Web.config连不上数据库
    • ¥15 我想付费需要AKM公司DSP开发资料及相关开发。
    • ¥15 怎么配置广告联盟瀑布流
    • ¥15 Rstudio 保存代码闪退