{"action":"created","issue":{"url":"https://api.github.com/repos/symfony/symfony/issues/20784","repository_url":"https://api.github.com/repos/symfony/symfony","labels_url":"https://api.github.com/repos/symfony/symfony/issues/20784/labels{/name}","comments_url":"https://api.github.com/repos/symfony/symfony/issues/20784/comments","events_url":"https://api.github.com/repos/symfony/symfony/issues/20784/events","html_url":"https://github.com/symfony/symfony/issues/20784","id":193779628,"node_id":"MDU6SXNzdWUxOTM3Nzk2Mjg=","number":20784,"title":"[Form] How to know with certaintity if $form->getData() returns valid data?","user":{"login":"Isinlor","id":528893,"node_id":"MDQ6VXNlcjUyODg5Mw==","avatar_url":"https://avatars3.githubusercontent.com/u/528893?v=4","gravatar_id":"","url":"https://api.github.com/users/Isinlor","html_url":"https://github.com/Isinlor","followers_url":"https://api.github.com/users/Isinlor/followers","following_url":"https://api.github.com/users/Isinlor/following{/other_user}","gists_url":"https://api.github.com/users/Isinlor/gists{/gist_id}","starred_url":"https://api.github.com/users/Isinlor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Isinlor/subscriptions","organizations_url":"https://api.github.com/users/Isinlor/orgs","repos_url":"https://api.github.com/users/Isinlor/repos","events_url":"https://api.github.com/users/Isinlor/events{/privacy}","received_events_url":"https://api.github.com/users/Isinlor/received_events","type":"User","site_admin":false},"labels":[{"id":99594,"node_id":"MDU6TGFiZWw5OTU5NA==","url":"https://api.github.com/repos/symfony/symfony/labels/Form","name":"Form","color":"DDDDDD","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":12,"created_at":"2016-12-06T14:01:50Z","updated_at":"2018-09-23T11:30:02Z","closed_at":"2018-09-23T11:30:02Z","author_association":"NONE","body":"[Submitted and disabled form is always valid.](https://github.com/symfony/form/blob/master/Form.php#L724) So in the situation:\r\n```\r\n    if ($form->isSubmitted() && $form->isValid()) {\r\n        $data = $from->getData();\r\n        // handle data ...\r\n    }\r\n```\r\n\r\nIs it expected that code depending on `$form->getData()` is able to handle [complete lack of data](https://github.com/symfony/form/blob/master/Form.php#L506) even if the from is valid? Or should I always check that form is not disabled? So instead recommended `if ($form->isSubmitted() && $form->isValid()) {` default to `if ($form->isSubmitted() && $form->isValid() && !$from->isDisabled()) {`?\r\n\r\n@edit I'm asking the question because I saw deprecation of calling `$form->isValid()` when the form is not submitted, but the issue mentioned above bothers me much more. I'm curious if I'm missing something or the part  `if ($this->isDisabled()) { return true; }` should be removed from there (or at least better documented)."},"comment":{"url":"https://api.github.com/repos/symfony/symfony/issues/comments/423809680","html_url":"https://github.com/symfony/symfony/issues/20784#issuecomment-423809680","issue_url":"https://api.github.com/repos/symfony/symfony/issues/20784","id":423809680,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMzgwOTY4MA==","user":{"login":"xabbuh","id":1957048,"node_id":"MDQ6VXNlcjE5NTcwNDg=","avatar_url":"https://avatars0.githubusercontent.com/u/1957048?v=4","gravatar_id":"","url":"https://api.github.com/users/xabbuh","html_url":"https://github.com/xabbuh","followers_url":"https://api.github.com/users/xabbuh/followers","following_url":"https://api.github.com/users/xabbuh/following{/other_user}","gists_url":"https://api.github.com/users/xabbuh/gists{/gist_id}","starred_url":"https://api.github.com/users/xabbuh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xabbuh/subscriptions","organizations_url":"https://api.github.com/users/xabbuh/orgs","repos_url":"https://api.github.com/users/xabbuh/repos","events_url":"https://api.github.com/users/xabbuh/events{/privacy}","received_events_url":"https://api.github.com/users/xabbuh/received_events","type":"User","site_admin":false},"created_at":"2018-09-23T11:30:02Z","updated_at":"2018-09-23T11:30:02Z","author_association":"MEMBER","body":"closing in favour of #27217"}}
{"actor":{"display_login":"xabbuh"}}