{"action":"created","issue":{"url":"https://api.github.com/repos/briceburg/silverstripe-pickerfield/issues/8","repository_url":"https://api.github.com/repos/briceburg/silverstripe-pickerfield","labels_url":"https://api.github.com/repos/briceburg/silverstripe-pickerfield/issues/8/labels{/name}","comments_url":"https://api.github.com/repos/briceburg/silverstripe-pickerfield/issues/8/comments","events_url":"https://api.github.com/repos/briceburg/silverstripe-pickerfield/issues/8/events","html_url":"https://github.com/briceburg/silverstripe-pickerfield/issues/8","id":69740336,"number":8,"title":"HasOnePickerField issue when creating new","user":{"login":"sudomabider","id":4270905,"avatar_url":"https://avatars.githubusercontent.com/u/4270905?v=3","gravatar_id":"","url":"https://api.github.com/users/sudomabider","html_url":"https://github.com/sudomabider","followers_url":"https://api.github.com/users/sudomabider/followers","following_url":"https://api.github.com/users/sudomabider/following{/other_user}","gists_url":"https://api.github.com/users/sudomabider/gists{/gist_id}","starred_url":"https://api.github.com/users/sudomabider/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sudomabider/subscriptions","organizations_url":"https://api.github.com/users/sudomabider/orgs","repos_url":"https://api.github.com/users/sudomabider/repos","events_url":"https://api.github.com/users/sudomabider/events{/privacy}","received_events_url":"https://api.github.com/users/sudomabider/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":12,"created_at":"2015-04-21T04:26:16Z","updated_at":"2016-08-23T02:35:15Z","closed_at":null,"body":"#### Issue description:\r\nFor simplicity let's say the relationship is **Product has_one Producer**. Both are subclasses of *DataObject*. Within the **Product** CMSfields is a HasOnePickerField for **Producer** which goes:\r\n```\r\nHasOnePickerField::create($this, 'ProducerID', 'Producer', $this->Producer(), 'Select');\r\n```\r\nWhen editing an existing **Product** everything works fine. When adding a new **Product** however, after clicking on a **Producer** from the popup list, the animation fires and then the page is unchanged and unaware of the selection. At the same time, a new **Product** entry is created in the database with the just selected **Producer** and every other attribute blank.\r\n\r\n#### Suspected Reason\r\nWhen the **Producer** is clicked on from the popup list, an **add** action is called on the controller (PickerFieldAddExistingSearchHandler?). This action performs a write to db in order to establish the link between the current **Product** and the selected **Producer** so the selection can be reflected on the page. But which **Product** does it write to? It creates a new entry and writes to it. \r\n\r\nNow I'm not sure if this is something in your code or in mine or silverstripe's own. It's a relatively clean install so I'd like to think it's not my code. But I have a similar issue with *RelationEditor* (autocomplete doesn't work) when creating new entries and it works fine when editing.\r\n\r\n\r\n\r\nAny advise?\r\n\r\nThanks,\r\nVeo"},"comment":{"url":"https://api.github.com/repos/briceburg/silverstripe-pickerfield/issues/comments/241610288","html_url":"https://github.com/briceburg/silverstripe-pickerfield/issues/8#issuecomment-241610288","issue_url":"https://api.github.com/repos/briceburg/silverstripe-pickerfield/issues/8","id":241610288,"user":{"login":"namnn96","id":8945395,"avatar_url":"https://avatars.githubusercontent.com/u/8945395?v=3","gravatar_id":"","url":"https://api.github.com/users/namnn96","html_url":"https://github.com/namnn96","followers_url":"https://api.github.com/users/namnn96/followers","following_url":"https://api.github.com/users/namnn96/following{/other_user}","gists_url":"https://api.github.com/users/namnn96/gists{/gist_id}","starred_url":"https://api.github.com/users/namnn96/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/namnn96/subscriptions","organizations_url":"https://api.github.com/users/namnn96/orgs","repos_url":"https://api.github.com/users/namnn96/repos","events_url":"https://api.github.com/users/namnn96/events{/privacy}","received_events_url":"https://api.github.com/users/namnn96/received_events","type":"User","site_admin":false},"created_at":"2016-08-23T02:35:15Z","updated_at":"2016-08-23T02:35:15Z","body":"@HARVS1789UK ,\r\n\r\nActually I have no problem with add existing, I just have issue when adding new item.\r\n\r\nIt goes to a newItemForm, Save button works, but not Save and close, which supposes to work as usual. Any recon? Thanks"}}
{"actor":{"display_login":"namnn96"}}