{"action":"created","issue":{"url":"https://api.github.com/repos/symfony/symfony/issues/27660","repository_url":"https://api.github.com/repos/symfony/symfony","labels_url":"https://api.github.com/repos/symfony/symfony/issues/27660/labels{/name}","comments_url":"https://api.github.com/repos/symfony/symfony/issues/27660/comments","events_url":"https://api.github.com/repos/symfony/symfony/issues/27660/events","html_url":"https://github.com/symfony/symfony/issues/27660","id":334130740,"node_id":"MDU6SXNzdWUzMzQxMzA3NDA=","number":27660,"title":"Feature Request: Allow to pass an array of fields to `allow_extra_fields` in Form","user":{"login":"pascalwacker","id":772008,"node_id":"MDQ6VXNlcjc3MjAwOA==","avatar_url":"https://avatars3.githubusercontent.com/u/772008?v=4","gravatar_id":"","url":"https://api.github.com/users/pascalwacker","html_url":"https://github.com/pascalwacker","followers_url":"https://api.github.com/users/pascalwacker/followers","following_url":"https://api.github.com/users/pascalwacker/following{/other_user}","gists_url":"https://api.github.com/users/pascalwacker/gists{/gist_id}","starred_url":"https://api.github.com/users/pascalwacker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pascalwacker/subscriptions","organizations_url":"https://api.github.com/users/pascalwacker/orgs","repos_url":"https://api.github.com/users/pascalwacker/repos","events_url":"https://api.github.com/users/pascalwacker/events{/privacy}","received_events_url":"https://api.github.com/users/pascalwacker/received_events","type":"User","site_admin":false},"labels":[{"id":100378,"node_id":"MDU6TGFiZWwxMDAzNzg=","url":"https://api.github.com/repos/symfony/symfony/labels/Feature","name":"Feature","color":"02e10c","default":false},{"id":99594,"node_id":"MDU6TGFiZWw5OTU5NA==","url":"https://api.github.com/repos/symfony/symfony/labels/Form","name":"Form","color":"DDDDDD","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-06-20T15:25:08Z","updated_at":"2018-06-23T15:39:46Z","closed_at":null,"author_association":"NONE","body":"**Description**  \r\nCurrently the Form component in Symfony has the option to allow additional fields by setting `allow_extra_fields` to true (http://symfony.com/doc/current/reference/forms/types/form.html#allow-extra-fields).\r\nAs of today, you can only specify a boolean either true or false. I'd propose to, besides having just booleans, also allow passing an array of strings as value. This would work as a mixture of both options, by allowing all fields, whose names are specified in that array, but still forbid all others. This would give devs a finer granularity in what should be allowed in forms and what not.\r\n\r\n**Example**  \r\nCurrently we can only set a form to accept all or none additional fields. Ex. `$this->createFormBuilder(null, ['allow_extra_fields' => true])`, With this proposal, we could pass something like `$this->createFormBuilder(null, ['allow_extra_fields' => ['foo', 'bar']])`. The form would then accept fields with the name `foo` and `bar` but still reject others, like `baz`.\r\n"},"comment":{"url":"https://api.github.com/repos/symfony/symfony/issues/comments/399687184","html_url":"https://github.com/symfony/symfony/issues/27660#issuecomment-399687184","issue_url":"https://api.github.com/repos/symfony/symfony/issues/27660","id":399687184,"node_id":"MDEyOklzc3VlQ29tbWVudDM5OTY4NzE4NA==","user":{"login":"pascalwacker","id":772008,"node_id":"MDQ6VXNlcjc3MjAwOA==","avatar_url":"https://avatars3.githubusercontent.com/u/772008?v=4","gravatar_id":"","url":"https://api.github.com/users/pascalwacker","html_url":"https://github.com/pascalwacker","followers_url":"https://api.github.com/users/pascalwacker/followers","following_url":"https://api.github.com/users/pascalwacker/following{/other_user}","gists_url":"https://api.github.com/users/pascalwacker/gists{/gist_id}","starred_url":"https://api.github.com/users/pascalwacker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pascalwacker/subscriptions","organizations_url":"https://api.github.com/users/pascalwacker/orgs","repos_url":"https://api.github.com/users/pascalwacker/repos","events_url":"https://api.github.com/users/pascalwacker/events{/privacy}","received_events_url":"https://api.github.com/users/pascalwacker/received_events","type":"User","site_admin":false},"created_at":"2018-06-23T15:39:46Z","updated_at":"2018-06-23T15:39:46Z","author_association":"NONE","body":"@unckleg it seemed to be a quick fix and I already made a pull request https://github.com/symfony/symfony/pull/27692\r\n\r\nIf you do find the time to look at it, I'd be glad for feedback or if you see room for improvement, let me know."}}
{"actor":{"display_login":"pascalwacker"}}