{"action":"created","issue":{"url":"https://api.github.com/repos/adamwathan/form/issues/108","repository_url":"https://api.github.com/repos/adamwathan/form","labels_url":"https://api.github.com/repos/adamwathan/form/issues/108/labels{/name}","comments_url":"https://api.github.com/repos/adamwathan/form/issues/108/comments","events_url":"https://api.github.com/repos/adamwathan/form/issues/108/events","html_url":"https://github.com/adamwathan/form/pull/108","id":193804860,"number":108,"title":"Safer old input binding when multiple forms on page","user":{"login":"JesseLeite","id":5187394,"avatar_url":"https://avatars.githubusercontent.com/u/5187394?v=3","gravatar_id":"","url":"https://api.github.com/users/JesseLeite","html_url":"https://github.com/JesseLeite","followers_url":"https://api.github.com/users/JesseLeite/followers","following_url":"https://api.github.com/users/JesseLeite/following{/other_user}","gists_url":"https://api.github.com/users/JesseLeite/gists{/gist_id}","starred_url":"https://api.github.com/users/JesseLeite/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JesseLeite/subscriptions","organizations_url":"https://api.github.com/users/JesseLeite/orgs","repos_url":"https://api.github.com/users/JesseLeite/repos","events_url":"https://api.github.com/users/JesseLeite/events{/privacy}","received_events_url":"https://api.github.com/users/JesseLeite/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-12-06T15:39:54Z","updated_at":"2016-12-06T15:54:31Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/adamwathan/form/pulls/108","html_url":"https://github.com/adamwathan/form/pull/108","diff_url":"https://github.com/adamwathan/form/pull/108.diff","patch_url":"https://github.com/adamwathan/form/pull/108.patch"},"body":"This is a bugfix for old input binding when there are multiple forms on a page.\r\n\r\nUse case:\r\n- You have two forms on a page, and both have bound data.\r\n- When you submit one form with validation errors, the other form will not respect bound data, because of the blanket `hasOldInput()` check (which is not form specific, as the whole request might contain old input from one form, but not the other).\r\n\r\nThis fix checks the old input provider on a key-by-key basis, rather than doing a blanket `hasOldInput()` check for all forms on page."},"comment":{"url":"https://api.github.com/repos/adamwathan/form/issues/comments/265186940","html_url":"https://github.com/adamwathan/form/pull/108#issuecomment-265186940","issue_url":"https://api.github.com/repos/adamwathan/form/issues/108","id":265186940,"user":{"login":"JesseLeite","id":5187394,"avatar_url":"https://avatars.githubusercontent.com/u/5187394?v=3","gravatar_id":"","url":"https://api.github.com/users/JesseLeite","html_url":"https://github.com/JesseLeite","followers_url":"https://api.github.com/users/JesseLeite/followers","following_url":"https://api.github.com/users/JesseLeite/following{/other_user}","gists_url":"https://api.github.com/users/JesseLeite/gists{/gist_id}","starred_url":"https://api.github.com/users/JesseLeite/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JesseLeite/subscriptions","organizations_url":"https://api.github.com/users/JesseLeite/orgs","repos_url":"https://api.github.com/users/JesseLeite/repos","events_url":"https://api.github.com/users/JesseLeite/events{/privacy}","received_events_url":"https://api.github.com/users/JesseLeite/received_events","type":"User","site_admin":false},"created_at":"2016-12-06T15:54:31Z","updated_at":"2016-12-06T15:54:31Z","body":"Yeah I just ran into that with checkboxes.\r\n\r\n```\r\nThere were 2 failures:\r\n\r\n1) OldInputTest::testOldInputOnCheckboxTakesPrecedenceOverDefaultToChecked\r\nFailed asserting that two strings are equal.\r\n--- Expected\r\n+++ Actual\r\n@@ @@\r\n-'<input type=\"checkbox\" name=\"published\" value=\"1\">'\r\n+'<input type=\"checkbox\" name=\"published\" value=\"1\" checked=\"checked\">'\r\n\r\n/Users/jesseleite/Code/form/tests/OldInputTest.php:220\r\n\r\n2) OldInputTest::testOldInputOnRadioTakesPrecedenceOverDefaultToChecked\r\nFailed asserting that two strings are equal.\r\n--- Expected\r\n+++ Actual\r\n@@ @@\r\n-'<input type=\"radio\" name=\"published\" value=\"1\">'\r\n+'<input type=\"radio\" name=\"published\" value=\"1\" checked=\"checked\">'\r\n```\r\n\r\nIs it possible to discern *which form* has the old input, rather than assuming it for all forms on page?  After all, if you submit one form, you'll only get the old input from that submitted form, not the other."}}
{"actor":{"display_login":"JesseLeite"}}