簡體   English   中英

Symfony2 表單提交錯誤(提交前設置關系)

[英]Symfony2 form submission error (setting a relation before submitting)

這是我的粘貼:

https://gist.github.com/1026584

以上產生錯誤:

Fatal error: method_exists(): The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition "Proxies\JStoutMainBundleEntityLocationProxy" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide a __autoload() function to load the class definition in /www/jstout/vendor/doctrine/lib/Doctrine/ORM/UnitOfWork.php on line 2266 Call Stack: 0.0001 622816 1. {main}() /www/jstout/web/app_dev.php:0 0.0120 1391096 2. Symfony\Component\HttpKernel\Kernel->handle() /www/jstout/web/app_dev.php:21 0.0155 1643168 3. Symfony\Bundle\FrameworkBundle\HttpKernel->handle() /www/jstout/app/bootstrap.php.cache:612 0.0155 1643888 4. Symfony\Component\HttpKernel\HttpKernel->handle() /www/jstout/vendor/symfony/src/Symfony/Bundle/FrameworkBundle/HttpKernel.php:44 0.0155 1643888 5. Symfony\Component\HttpKernel\HttpKernel->handleRaw() /www/jstout/app/bootstrap.php.cache:416 0.0808 3808568 6. call_user_func_array() /www/jstout/app/bootstrap.php.cache:438 0.0808 3808816 7. JStout\MainBundle\Controller\VendorController->signupAction() /www/jstout/app/bootstrap.php.cache:0 0.1496 5248224 8. JStout\MainBundle\Form\Vendor\SignupHandler->process() /www/jstout/src/JStout/MainBundle/Controller/VendorController.php:55 0.1994 6163232 9. Doctrine\ORM\EntityManager->flush() /www/jstout/src/JStout/MainBundle/Form/Vendor/SignupHandler.php:57 0.1994 6163232 10. Doctrine\ORM\UnitOfWork->commit() /www/jstout/vendor/doctrine/lib/Doctrine/ORM/EntityManager.php:328 0.1994 6163232 11. Doctrine\ORM\UnitOfWork->computeChangeSets() /www/jstout/vendor/doctrine/lib/Doctrine/ORM/UnitOfWork.php:249 0.1998 6187424 12. Doctrine\ORM\UnitOfWork->computeChangeSet() /www/jstout/vendor/doctrine/lib/Doctrine/ORM/UnitOfWork.php:505 0.2000 6196648 13. Doctrine\ORM\UnitOfWork->computeAssociationChanges() /www/jstout/vendor/doctrine/lib/Doctrine/ORM/UnitOfWork.php:490 0.2000 6221624 14. Doctrine\ORM\UnitOfWork::objToStr() /www/jstout/vendor/doctrine/lib/Doctrine/ORM/UnitOfWork.php:572 0.2000 6221752 15. method_exists() /www/jstout/vendor/doctrine/lib/Doctrine/ORM/UnitOfWork.php:2266

如果我刪除,錯誤就會消失:

$vendor->setOwner($user)

這是一個錯誤還是我無法將所有者設置為 session object 的原因?

您的用戶 object 中是否有私有屬性?

php function 序列化在 Z21D6F40CFB5125082E457ZE 中插入 object 時被調用,並且存在具有 5 個私有屬性的問題。 您必須將這些私有屬性轉換為受保護的。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM