{"action":"opened","issue":{"url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/issues/3702","repository_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle","labels_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/issues/3702/labels{/name}","comments_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/issues/3702/comments","events_url":"https://api.github.com/repos/sonata-project/SonataAdminBundle/issues/3702/events","html_url":"https://github.com/sonata-project/SonataAdminBundle/issues/3702","id":145701788,"number":3702,"title":"sonata_type_collection with subclasses - on create problem when subclass entry is not valid","user":{"login":"kozltomasz","id":14977487,"avatar_url":"https://avatars.githubusercontent.com/u/14977487?v=3","gravatar_id":"","url":"https://api.github.com/users/kozltomasz","html_url":"https://github.com/kozltomasz","followers_url":"https://api.github.com/users/kozltomasz/followers","following_url":"https://api.github.com/users/kozltomasz/following{/other_user}","gists_url":"https://api.github.com/users/kozltomasz/gists{/gist_id}","starred_url":"https://api.github.com/users/kozltomasz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kozltomasz/subscriptions","organizations_url":"https://api.github.com/users/kozltomasz/orgs","repos_url":"https://api.github.com/users/kozltomasz/repos","events_url":"https://api.github.com/users/kozltomasz/events{/privacy}","received_events_url":"https://api.github.com/users/kozltomasz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-04-04T14:32:39Z","updated_at":"2016-04-04T14:32:39Z","closed_at":null,"body":"Hi\r\nI have Product entity with is related to ProductPrice (OneToMany).\r\n`    class Product\r\n    {\r\n\r\n    /**\r\n     * @ORM\\OneToMany(targetEntity=\"ProductPrice\", mappedBy=\"product\", cascade={\"all\"})\r\n     */\r\n    protected $prices;\r\n\r\n    }\r\n`\r\n\r\nThe prices field in ProductAdmin is defined like that:\r\n`$formMapper\r\n            ->add('prices', 'sonata_type_collection', [\r\n                'required'     => false,\r\n                'by_reference' => false,\r\n                'type_options' => [\r\n                    'delete' => true\r\n                ],\r\n                'btn_add' => 'Add new pricing scheme'\r\n            ], [\r\n                'edit'   => 'inline',\r\n                'inline' => 'table'\r\n            ])`\r\n\r\nThe problem is when adding new Product, and ProductPrice immediately and the Product price is invalid or some of values missing. \r\n![2016-04-04_1618](https://cloud.githubusercontent.com/assets/14977487/14251142/de6249f8-fa81-11e5-8c8a-2e923f198eda.png)\r\n\r\nThen of course new product is not added, the error message is given, but the form is reloaded too. The new form is update form.\r\n![2016-04-04_1619](https://cloud.githubusercontent.com/assets/14977487/14251157/fb77cad6-fa81-11e5-92a7-13c8a35b1791.png)\r\n\r\nAfter passing correct value to ProductPrice and clicking update we have got \r\n\"unable to find the object with id : 22\r\n404 Not Found - NotFoundHttpException\".\r\n\r\nSince the Product wasn't added to the database correctly, why update form appeared?\r\nShouldn't create form be still there?\r\n\r\n"}}