{"action":"created","issue":{"url":"https://api.github.com/repos/silverstripe/silverstripe-admin/issues/755","repository_url":"https://api.github.com/repos/silverstripe/silverstripe-admin","labels_url":"https://api.github.com/repos/silverstripe/silverstripe-admin/issues/755/labels{/name}","comments_url":"https://api.github.com/repos/silverstripe/silverstripe-admin/issues/755/comments","events_url":"https://api.github.com/repos/silverstripe/silverstripe-admin/issues/755/events","html_url":"https://github.com/silverstripe/silverstripe-admin/issues/755","id":382312239,"node_id":"MDU6SXNzdWUzODIzMTIyMzk=","number":755,"title":"Field value declaration is different for Entwine and React form fields","user":{"login":"robbieaverill","id":5170590,"node_id":"MDQ6VXNlcjUxNzA1OTA=","avatar_url":"https://avatars1.githubusercontent.com/u/5170590?v=4","gravatar_id":"","url":"https://api.github.com/users/robbieaverill","html_url":"https://github.com/robbieaverill","followers_url":"https://api.github.com/users/robbieaverill/followers","following_url":"https://api.github.com/users/robbieaverill/following{/other_user}","gists_url":"https://api.github.com/users/robbieaverill/gists{/gist_id}","starred_url":"https://api.github.com/users/robbieaverill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robbieaverill/subscriptions","organizations_url":"https://api.github.com/users/robbieaverill/orgs","repos_url":"https://api.github.com/users/robbieaverill/repos","events_url":"https://api.github.com/users/robbieaverill/events{/privacy}","received_events_url":"https://api.github.com/users/robbieaverill/received_events","type":"User","site_admin":false},"labels":[{"id":577495320,"node_id":"MDU6TGFiZWw1Nzc0OTUzMjA=","url":"https://api.github.com/repos/silverstripe/silverstripe-admin/labels/affects/v4","name":"affects/v4","color":"5319e7","default":false},{"id":587716149,"node_id":"MDU6TGFiZWw1ODc3MTYxNDk=","url":"https://api.github.com/repos/silverstripe/silverstripe-admin/labels/effort/medium","name":"effort/medium","color":"fef2c0","default":false},{"id":587716222,"node_id":"MDU6TGFiZWw1ODc3MTYyMjI=","url":"https://api.github.com/repos/silverstripe/silverstripe-admin/labels/impact/high","name":"impact/high","color":"eb6420","default":false},{"id":557308894,"node_id":"MDU6TGFiZWw1NTczMDg4OTQ=","url":"https://api.github.com/repos/silverstripe/silverstripe-admin/labels/type/bug","name":"type/bug","color":"d93f0b","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-11-19T17:09:38Z","updated_at":"2018-11-26T21:02:50Z","closed_at":null,"author_association":"MEMBER","body":"**Version: SS 4.3.x-dev**\r\n\r\n## Background\r\n\r\nI'm trying to make the [silverstripe-tagfield module](https://github.com/silverstripe/silverstripe-tagfield/pull/122) work correctly in a React form context.\r\n\r\n## Problem\r\n\r\nIt looks like Entwine initiated React form fields read their attributes from a different place to that of the React form builder's fields.\r\n\r\nFor example, to get the tagfield form to correctly populate its saved values, the `value` attribute must be populated from the `getSchemaData()` method. For the same field, it must be populated in the `getSchemaState()` method to work in React forms. In the React case, it puts the value into the Redux store and populates it from there via redux-form.\r\n\r\nThe issue here is that having the value defined in both places means that it doesn't populate in the React context. The Entwine initiated field doesn't have the redux store available for the form to pull the data out of.\r\n\r\nAnother example of this is the `name` attribute. Because the select fields (related: #52) add hidden input fields for each tag selected, the name attribute needs to be an HTML array. To make this work in Entwine context, the `name` attribute must be added in `getSchemaData()`, but for React it must be in `getAttributes()`. If I have the `name` in `getSchemaData()` then the React form doesn't work, throwing console errors and some kind of infinite re-rendering loop error.\r\n\r\nI can get this field to work in each context just fine by moving the placement of these two pieces of schema data around in the PHP class definition, but I can't get it to work with both at the same time."},"comment":{"url":"https://api.github.com/repos/silverstripe/silverstripe-admin/issues/comments/441796859","html_url":"https://github.com/silverstripe/silverstripe-admin/issues/755#issuecomment-441796859","issue_url":"https://api.github.com/repos/silverstripe/silverstripe-admin/issues/755","id":441796859,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0MTc5Njg1OQ==","user":{"login":"robbieaverill","id":5170590,"node_id":"MDQ6VXNlcjUxNzA1OTA=","avatar_url":"https://avatars1.githubusercontent.com/u/5170590?v=4","gravatar_id":"","url":"https://api.github.com/users/robbieaverill","html_url":"https://github.com/robbieaverill","followers_url":"https://api.github.com/users/robbieaverill/followers","following_url":"https://api.github.com/users/robbieaverill/following{/other_user}","gists_url":"https://api.github.com/users/robbieaverill/gists{/gist_id}","starred_url":"https://api.github.com/users/robbieaverill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robbieaverill/subscriptions","organizations_url":"https://api.github.com/users/robbieaverill/orgs","repos_url":"https://api.github.com/users/robbieaverill/repos","events_url":"https://api.github.com/users/robbieaverill/events{/privacy}","received_events_url":"https://api.github.com/users/robbieaverill/received_events","type":"User","site_admin":false},"created_at":"2018-11-26T21:02:50Z","updated_at":"2018-11-26T21:02:50Z","author_association":"MEMBER","body":"It's quite possible that I've put the schema data/attributes into the wrong methods, to be fair. Either way I think that if it's difficult for me (as a core committer) then there's something to be improved here, even if it's documentation"}}
{"actor":{"display_login":"robbieaverill"}}