{"action":"created","comment":{"url":"https://api.github.com/repos/symfony/symfony/pulls/comments/57480609","id":57480609,"diff_hunk":"@@ -0,0 +1,11 @@\n+<?xml version=\"1.0\"?>\n+<xliff version=\"1.2\" xmlns=\"urn:oasis:names:tc:xliff:document:1.2\">\n+    <file source-language=\"en\" datatype=\"plaintext\" original=\"file.ext\">\n+        <body>\n+            <trans-unit id=\"1\">\n+                <source>No choice available</source>\n+                <target>![CDATA[<em>No choice available.</em>]]</target>","path":"src/Symfony/Component/Form/Resources/translations/sf_form.en.xlf","position":7,"original_position":7,"commit_id":"f68e1e070c8918a02e7bfd27d2599a259fac2582","original_commit_id":"f68e1e070c8918a02e7bfd27d2599a259fac2582","user":{"login":"backbone87","id":1196313,"avatar_url":"https://avatars.githubusercontent.com/u/1196313?v=3","gravatar_id":"","url":"https://api.github.com/users/backbone87","html_url":"https://github.com/backbone87","followers_url":"https://api.github.com/users/backbone87/followers","following_url":"https://api.github.com/users/backbone87/following{/other_user}","gists_url":"https://api.github.com/users/backbone87/gists{/gist_id}","starred_url":"https://api.github.com/users/backbone87/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/backbone87/subscriptions","organizations_url":"https://api.github.com/users/backbone87/orgs","repos_url":"https://api.github.com/users/backbone87/repos","events_url":"https://api.github.com/users/backbone87/events{/privacy}","received_events_url":"https://api.github.com/users/backbone87/received_events","type":"User","site_admin":false},"body":"the cdata tags have syntax errors. correct is: `<![CDATA[` and `]]>` (not escaped)","created_at":"2016-03-25T19:24:47Z","updated_at":"2016-03-25T19:24:47Z","html_url":"https://github.com/symfony/symfony/pull/17609#discussion_r57480609","pull_request_url":"https://api.github.com/repos/symfony/symfony/pulls/17609","_links":{"self":{"href":"https://api.github.com/repos/symfony/symfony/pulls/comments/57480609"},"html":{"href":"https://github.com/symfony/symfony/pull/17609#discussion_r57480609"},"pull_request":{"href":"https://api.github.com/repos/symfony/symfony/pulls/17609"}}},"pull_request":{"url":"https://api.github.com/repos/symfony/symfony/pulls/17609","id":57736481,"html_url":"https://github.com/symfony/symfony/pull/17609","diff_url":"https://github.com/symfony/symfony/pull/17609.diff","patch_url":"https://github.com/symfony/symfony/pull/17609.patch","issue_url":"https://api.github.com/repos/symfony/symfony/issues/17609","number":17609,"state":"open","locked":false,"title":"[WIP] [3.1] [Form] add 'empty_view' option in FormType","user":{"login":"HeahDude","id":10107633,"avatar_url":"https://avatars.githubusercontent.com/u/10107633?v=3","gravatar_id":"","url":"https://api.github.com/users/HeahDude","html_url":"https://github.com/HeahDude","followers_url":"https://api.github.com/users/HeahDude/followers","following_url":"https://api.github.com/users/HeahDude/following{/other_user}","gists_url":"https://api.github.com/users/HeahDude/gists{/gist_id}","starred_url":"https://api.github.com/users/HeahDude/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HeahDude/subscriptions","organizations_url":"https://api.github.com/users/HeahDude/orgs","repos_url":"https://api.github.com/users/HeahDude/repos","events_url":"https://api.github.com/users/HeahDude/events{/privacy}","received_events_url":"https://api.github.com/users/HeahDude/received_events","type":"User","site_admin":false},"body":"| Q             | A\r\n| ------------- | ---\r\n| Bug fix?      | yes\r\n| New feature?  | yes\r\n| BC breaks?    | no\r\n| Deprecations? | no\r\n| Tests pass?   | yes\r\n| Fixed tickets | #17579\r\n| License       | MIT\r\n| Doc PR        | todo\r\n\r\n- [ ]  Gather feedback\r\n- [x]  Use translation for default message\r\n- [x]  Add some tests\r\n- [x]  Update foundation 5 theme\r\n- [ ] Make tests pass\r\n- [ ]  Add missing translations\r\n- [ ]  Doc PR\r\n\r\nThe `empty_view` option can be a `string`, or a `boolean`. By default it is `'No field'` when compound and `false` otherwise. It uses the `translation_domain` option for its translation.\r\n\r\n`CollectionType` inherits it but this can be avoid be setting `empty_view` to `false`.\r\n\r\nThe `empty_view` is defined in `FormType::finishView()` and overriden in `ChoiceType::finishView()` to be defined when `choices` and `preferred_choices` view vars are empty.\r\n\r\nIn the templates, the old behaviour is kept explicitly set to `false`.\r\n\r\nSo 2 ways of using it:\r\n- passing a translatable simple string to custom a message instead of an empty `div` or an empty `select` input :\r\n```php\r\n// src/AppBundle/Form/Type/TenantType.php\r\n// ...\r\n$builder->add('cars', \\Symfony\\Bridge\\Doctrine\\Form\\Type\\EntityType::class, array(\r\n    'class' => \\AppBundle\\Entity\\Cars::class,\r\n    'empty_view' => 'No cars available', // will be escaped\r\n    // ...\r\n));\r\n```\r\n- overriding the `empty_row` to use custom `html` :\r\n```twig\r\n{# 'default/rent_a_car.html.twig #}\r\n{# ... #}\r\n{% form_theme _self %}\r\n{% block 'empty_row' %}\r\n    {# custom html with access to 'full_name', 'attr', and 'empty_view' view vars #}\r\n{% endblock %}\r\n{{ form(form) }}\r\n```\r\n\r\nWhat do you think ?","created_at":"2016-01-30T10:25:59Z","updated_at":"2016-03-25T19:24:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f2416977f4d1009328f43bd1163346d17e4be4cb","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/symfony/symfony/pulls/17609/commits","review_comments_url":"https://api.github.com/repos/symfony/symfony/pulls/17609/comments","review_comment_url":"https://api.github.com/repos/symfony/symfony/pulls/comments{/number}","comments_url":"https://api.github.com/repos/symfony/symfony/issues/17609/comments","statuses_url":"https://api.github.com/repos/symfony/symfony/statuses/f68e1e070c8918a02e7bfd27d2599a259fac2582","head":{"label":"HeahDude:feature-choice_type_option-empty_choices","ref":"feature-choice_type_option-empty_choices","sha":"f68e1e070c8918a02e7bfd27d2599a259fac2582","user":{"login":"HeahDude","id":10107633,"avatar_url":"https://avatars.githubusercontent.com/u/10107633?v=3","gravatar_id":"","url":"https://api.github.com/users/HeahDude","html_url":"https://github.com/HeahDude","followers_url":"https://api.github.com/users/HeahDude/followers","following_url":"https://api.github.com/users/HeahDude/following{/other_user}","gists_url":"https://api.github.com/users/HeahDude/gists{/gist_id}","starred_url":"https://api.github.com/users/HeahDude/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HeahDude/subscriptions","organizations_url":"https://api.github.com/users/HeahDude/orgs","repos_url":"https://api.github.com/users/HeahDude/repos","events_url":"https://api.github.com/users/HeahDude/events{/privacy}","received_events_url":"https://api.github.com/users/HeahDude/received_events","type":"User","site_admin":false},"repo":{"id":27680958,"name":"symfony","full_name":"HeahDude/symfony","owner":{"login":"HeahDude","id":10107633,"avatar_url":"https://avatars.githubusercontent.com/u/10107633?v=3","gravatar_id":"","url":"https://api.github.com/users/HeahDude","html_url":"https://github.com/HeahDude","followers_url":"https://api.github.com/users/HeahDude/followers","following_url":"https://api.github.com/users/HeahDude/following{/other_user}","gists_url":"https://api.github.com/users/HeahDude/gists{/gist_id}","starred_url":"https://api.github.com/users/HeahDude/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HeahDude/subscriptions","organizations_url":"https://api.github.com/users/HeahDude/orgs","repos_url":"https://api.github.com/users/HeahDude/repos","events_url":"https://api.github.com/users/HeahDude/events{/privacy}","received_events_url":"https://api.github.com/users/HeahDude/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/HeahDude/symfony","description":"The Symfony PHP framework","fork":true,"url":"https://api.github.com/repos/HeahDude/symfony","forks_url":"https://api.github.com/repos/HeahDude/symfony/forks","keys_url":"https://api.github.com/repos/HeahDude/symfony/keys{/key_id}","collaborators_url":"https://api.github.com/repos/HeahDude/symfony/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/HeahDude/symfony/teams","hooks_url":"https://api.github.com/repos/HeahDude/symfony/hooks","issue_events_url":"https://api.github.com/repos/HeahDude/symfony/issues/events{/number}","events_url":"https://api.github.com/repos/HeahDude/symfony/events","assignees_url":"https://api.github.com/repos/HeahDude/symfony/assignees{/user}","branches_url":"https://api.github.com/repos/HeahDude/symfony/branches{/branch}","tags_url":"https://api.github.com/repos/HeahDude/symfony/tags","blobs_url":"https://api.github.com/repos/HeahDude/symfony/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/HeahDude/symfony/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/HeahDude/symfony/git/refs{/sha}","trees_url":"https://api.github.com/repos/HeahDude/symfony/git/trees{/sha}","statuses_url":"https://api.github.com/repos/HeahDude/symfony/statuses/{sha}","languages_url":"https://api.github.com/repos/HeahDude/symfony/languages","stargazers_url":"https://api.github.com/repos/HeahDude/symfony/stargazers","contributors_url":"https://api.github.com/repos/HeahDude/symfony/contributors","subscribers_url":"https://api.github.com/repos/HeahDude/symfony/subscribers","subscription_url":"https://api.github.com/repos/HeahDude/symfony/subscription","commits_url":"https://api.github.com/repos/HeahDude/symfony/commits{/sha}","git_commits_url":"https://api.github.com/repos/HeahDude/symfony/git/commits{/sha}","comments_url":"https://api.github.com/repos/HeahDude/symfony/comments{/number}","issue_comment_url":"https://api.github.com/repos/HeahDude/symfony/issues/comments{/number}","contents_url":"https://api.github.com/repos/HeahDude/symfony/contents/{+path}","compare_url":"https://api.github.com/repos/HeahDude/symfony/compare/{base}...{head}","merges_url":"https://api.github.com/repos/HeahDude/symfony/merges","archive_url":"https://api.github.com/repos/HeahDude/symfony/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/HeahDude/symfony/downloads","issues_url":"https://api.github.com/repos/HeahDude/symfony/issues{/number}","pulls_url":"https://api.github.com/repos/HeahDude/symfony/pulls{/number}","milestones_url":"https://api.github.com/repos/HeahDude/symfony/milestones{/number}","notifications_url":"https://api.github.com/repos/HeahDude/symfony/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/HeahDude/symfony/labels{/name}","releases_url":"https://api.github.com/repos/HeahDude/symfony/releases{/id}","deployments_url":"https://api.github.com/repos/HeahDude/symfony/deployments","created_at":"2014-12-07T19:00:38Z","updated_at":"2016-02-20T04:43:53Z","pushed_at":"2016-03-25T18:30:55Z","git_url":"git://github.com/HeahDude/symfony.git","ssh_url":"git@github.com:HeahDude/symfony.git","clone_url":"https://github.com/HeahDude/symfony.git","svn_url":"https://github.com/HeahDude/symfony","homepage":"symfony.com","size":69854,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"symfony:master","ref":"master","sha":"697bac9bf292ab956c746b57921a26be1d79427b","user":{"login":"symfony","id":143937,"avatar_url":"https://avatars.githubusercontent.com/u/143937?v=3","gravatar_id":"","url":"https://api.github.com/users/symfony","html_url":"https://github.com/symfony","followers_url":"https://api.github.com/users/symfony/followers","following_url":"https://api.github.com/users/symfony/following{/other_user}","gists_url":"https://api.github.com/users/symfony/gists{/gist_id}","starred_url":"https://api.github.com/users/symfony/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/symfony/subscriptions","organizations_url":"https://api.github.com/users/symfony/orgs","repos_url":"https://api.github.com/users/symfony/repos","events_url":"https://api.github.com/users/symfony/events{/privacy}","received_events_url":"https://api.github.com/users/symfony/received_events","type":"Organization","site_admin":false},"repo":{"id":458058,"name":"symfony","full_name":"symfony/symfony","owner":{"login":"symfony","id":143937,"avatar_url":"https://avatars.githubusercontent.com/u/143937?v=3","gravatar_id":"","url":"https://api.github.com/users/symfony","html_url":"https://github.com/symfony","followers_url":"https://api.github.com/users/symfony/followers","following_url":"https://api.github.com/users/symfony/following{/other_user}","gists_url":"https://api.github.com/users/symfony/gists{/gist_id}","starred_url":"https://api.github.com/users/symfony/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/symfony/subscriptions","organizations_url":"https://api.github.com/users/symfony/orgs","repos_url":"https://api.github.com/users/symfony/repos","events_url":"https://api.github.com/users/symfony/events{/privacy}","received_events_url":"https://api.github.com/users/symfony/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/symfony/symfony","description":"The Symfony PHP framework","fork":false,"url":"https://api.github.com/repos/symfony/symfony","forks_url":"https://api.github.com/repos/symfony/symfony/forks","keys_url":"https://api.github.com/repos/symfony/symfony/keys{/key_id}","collaborators_url":"https://api.github.com/repos/symfony/symfony/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/symfony/symfony/teams","hooks_url":"https://api.github.com/repos/symfony/symfony/hooks","issue_events_url":"https://api.github.com/repos/symfony/symfony/issues/events{/number}","events_url":"https://api.github.com/repos/symfony/symfony/events","assignees_url":"https://api.github.com/repos/symfony/symfony/assignees{/user}","branches_url":"https://api.github.com/repos/symfony/symfony/branches{/branch}","tags_url":"https://api.github.com/repos/symfony/symfony/tags","blobs_url":"https://api.github.com/repos/symfony/symfony/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/symfony/symfony/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/symfony/symfony/git/refs{/sha}","trees_url":"https://api.github.com/repos/symfony/symfony/git/trees{/sha}","statuses_url":"https://api.github.com/repos/symfony/symfony/statuses/{sha}","languages_url":"https://api.github.com/repos/symfony/symfony/languages","stargazers_url":"https://api.github.com/repos/symfony/symfony/stargazers","contributors_url":"https://api.github.com/repos/symfony/symfony/contributors","subscribers_url":"https://api.github.com/repos/symfony/symfony/subscribers","subscription_url":"https://api.github.com/repos/symfony/symfony/subscription","commits_url":"https://api.github.com/repos/symfony/symfony/commits{/sha}","git_commits_url":"https://api.github.com/repos/symfony/symfony/git/commits{/sha}","comments_url":"https://api.github.com/repos/symfony/symfony/comments{/number}","issue_comment_url":"https://api.github.com/repos/symfony/symfony/issues/comments{/number}","contents_url":"https://api.github.com/repos/symfony/symfony/contents/{+path}","compare_url":"https://api.github.com/repos/symfony/symfony/compare/{base}...{head}","merges_url":"https://api.github.com/repos/symfony/symfony/merges","archive_url":"https://api.github.com/repos/symfony/symfony/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/symfony/symfony/downloads","issues_url":"https://api.github.com/repos/symfony/symfony/issues{/number}","pulls_url":"https://api.github.com/repos/symfony/symfony/pulls{/number}","milestones_url":"https://api.github.com/repos/symfony/symfony/milestones{/number}","notifications_url":"https://api.github.com/repos/symfony/symfony/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/symfony/symfony/labels{/name}","releases_url":"https://api.github.com/repos/symfony/symfony/releases{/id}","deployments_url":"https://api.github.com/repos/symfony/symfony/deployments","created_at":"2010-01-04T14:21:21Z","updated_at":"2016-03-25T19:10:54Z","pushed_at":"2016-03-25T19:12:52Z","git_url":"git://github.com/symfony/symfony.git","ssh_url":"git@github.com:symfony/symfony.git","clone_url":"https://github.com/symfony/symfony.git","svn_url":"https://github.com/symfony/symfony","homepage":"symfony.com","size":104874,"stargazers_count":11998,"watchers_count":11998,"language":"PHP","has_issues":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":4726,"mirror_url":null,"open_issues_count":718,"forks":4726,"open_issues":718,"watchers":11998,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/symfony/symfony/pulls/17609"},"html":{"href":"https://github.com/symfony/symfony/pull/17609"},"issue":{"href":"https://api.github.com/repos/symfony/symfony/issues/17609"},"comments":{"href":"https://api.github.com/repos/symfony/symfony/issues/17609/comments"},"review_comments":{"href":"https://api.github.com/repos/symfony/symfony/pulls/17609/comments"},"review_comment":{"href":"https://api.github.com/repos/symfony/symfony/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/symfony/symfony/pulls/17609/commits"},"statuses":{"href":"https://api.github.com/repos/symfony/symfony/statuses/f68e1e070c8918a02e7bfd27d2599a259fac2582"}}}}