{"comment":{"created_at":"2011-10-18T22:14:24Z","body":"This is a bug in Doctrine. There is a PR fixing it: https://github.com/doctrine/doctrine2/pull/154","updated_at":"2011-10-18T22:14:24Z","url":"https://api.github.com/repos/symfony/symfony/issues/comments/2448587","id":2448587,"user":{"gravatar_id":"7894bbdf1c05b18a1444ad8c76c9d583","avatar_url":"https://secure.gravatar.com/avatar/7894bbdf1c05b18a1444ad8c76c9d583?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/stof","id":439401,"login":"stof"}},"action":"created","issue":{"number":2431,"created_at":"2011-10-18T22:09:06Z","pull_request":{"diff_url":null,"patch_url":null,"html_url":null},"body":"I'm actually trying to set up a very simple form research. This form doesn't use a class.\r\n\r\nMy form class :\r\n\r\n    use Symfony\\Component\\Form\\AbstractType;\r\n    use Symfony\\Component\\Form\\FormBuilder;\r\n\r\n    class SearchType extends AbstractType\r\n    {\r\n        public function buildForm(FormBuilder $builder, array $options)\r\n        {\r\n            $builder->add('search', 'text', array(\r\n                'label' => 'Research',\r\n                'max_length' => 100\r\n            ));\r\n        }\r\n\r\n        public function getName()\r\n        {\r\n            return 'form_search';\r\n        }\r\n    }\r\n\r\nMy action which renders the research form :\r\n\r\n    public function searchAction()\r\n    {\r\n        $form = $this->createForm(new SearchType());\r\n        \r\n        if($this->getRequest()->getMethod() === 'POST')\r\n        {\r\n            $form->bindRequest($this->getRequest());\r\n            \r\n            if($form->isValid())\r\n            {\r\n                \r\n            }\r\n        }\r\n        \r\n        return array('form_search' => $form->createView());\r\n    }\r\n\r\nWhen I execute this action, I have this error :\r\n\r\n    Fatal error: Call to a member function isTransient() on a non-object in /var/www/project.local/vendor/doctrine/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php on line 497\r\n\r\nAfter some debug, I realize that it is the ``bindRequest`` method which generates the PHP fatal error. \r\nI don't know if it is a mistake on my part or if it is a bug...","comments":1,"title":"Binding request to form gives a PHP fatal error","updated_at":"2011-10-18T22:14:24Z","url":"https://api.github.com/repos/symfony/symfony/issues/2431","id":1978229,"assignee":null,"milestone":null,"closed_at":null,"user":{"gravatar_id":"81e83270085f7f733a440c0283c4b39b","avatar_url":"https://secure.gravatar.com/avatar/81e83270085f7f733a440c0283c4b39b?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/egeloen","id":737992,"login":"egeloen"},"html_url":"https://github.com/symfony/symfony/issues/2431","labels":[],"state":"open"},"legacy":{"issue_id":1978229,"comment_id":2448587}}