{"action":"created","issue":{"url":"https://api.github.com/repos/kristijanhusak/laravel-form-builder/issues/272","repository_url":"https://api.github.com/repos/kristijanhusak/laravel-form-builder","labels_url":"https://api.github.com/repos/kristijanhusak/laravel-form-builder/issues/272/labels{/name}","comments_url":"https://api.github.com/repos/kristijanhusak/laravel-form-builder/issues/272/comments","events_url":"https://api.github.com/repos/kristijanhusak/laravel-form-builder/issues/272/events","html_url":"https://github.com/kristijanhusak/laravel-form-builder/pull/272","id":171968514,"number":272,"title":"Alter field values","user":{"login":"rudiedirkx","id":168024,"avatar_url":"https://avatars.githubusercontent.com/u/168024?v=3","gravatar_id":"","url":"https://api.github.com/users/rudiedirkx","html_url":"https://github.com/rudiedirkx","followers_url":"https://api.github.com/users/rudiedirkx/followers","following_url":"https://api.github.com/users/rudiedirkx/following{/other_user}","gists_url":"https://api.github.com/users/rudiedirkx/gists{/gist_id}","starred_url":"https://api.github.com/users/rudiedirkx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rudiedirkx/subscriptions","organizations_url":"https://api.github.com/users/rudiedirkx/orgs","repos_url":"https://api.github.com/users/rudiedirkx/repos","events_url":"https://api.github.com/users/rudiedirkx/events{/privacy}","received_events_url":"https://api.github.com/users/rudiedirkx/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-08-18T18:28:17Z","updated_at":"2016-08-23T17:09:34Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/kristijanhusak/laravel-form-builder/pulls/272","html_url":"https://github.com/kristijanhusak/laravel-form-builder/pull/272","diff_url":"https://github.com/kristijanhusak/laravel-form-builder/pull/272.diff","patch_url":"https://github.com/kristijanhusak/laravel-form-builder/pull/272.patch"},"body":"Added\r\n\r\n* `alterFieldValues()` to `Form` to alter that form's values\r\n* `alterFieldValues()` to `FormHelper` to call that alter and recurse through fields\r\n* `alterFieldValues()` to `ChildFormType` to act on and recurse through child forms\r\n\r\nThree different functions with the same name... Might not be the best.\r\n\r\nWith test!\r\n\r\nThere's still something missing and it might be part of this: form specific validation. If a child form has an image and another form has validation errors, the child form wants to add a validation message to reupload the image. The parent form could do this in `isValid()`, but that's not called for child forms... Ideas?"},"comment":{"url":"https://api.github.com/repos/kristijanhusak/laravel-form-builder/issues/comments/241804182","html_url":"https://github.com/kristijanhusak/laravel-form-builder/pull/272#issuecomment-241804182","issue_url":"https://api.github.com/repos/kristijanhusak/laravel-form-builder/issues/272","id":241804182,"user":{"login":"rudiedirkx","id":168024,"avatar_url":"https://avatars.githubusercontent.com/u/168024?v=3","gravatar_id":"","url":"https://api.github.com/users/rudiedirkx","html_url":"https://github.com/rudiedirkx","followers_url":"https://api.github.com/users/rudiedirkx/followers","following_url":"https://api.github.com/users/rudiedirkx/following{/other_user}","gists_url":"https://api.github.com/users/rudiedirkx/gists{/gist_id}","starred_url":"https://api.github.com/users/rudiedirkx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rudiedirkx/subscriptions","organizations_url":"https://api.github.com/users/rudiedirkx/orgs","repos_url":"https://api.github.com/users/rudiedirkx/repos","events_url":"https://api.github.com/users/rudiedirkx/events{/privacy}","received_events_url":"https://api.github.com/users/rudiedirkx/received_events","type":"User","site_admin":false},"created_at":"2016-08-23T17:09:34Z","updated_at":"2016-08-23T17:09:34Z","body":"`alterFieldValues()`:\r\n\r\n* checkboxes + none selected = missing value, but should be an empty array\r\n* dropdown of user reference where none selected = empty string or 0, but should be NULL\r\n\r\n`alterValid()`:\r\n\r\n* Uploading a file + other validation error = must reupload file, because file input can't have default value. A message to tell the user that would be nice.\r\n* Validation on a difficult combination of 3 or 4 form fields to make $isValid = FALSE.\r\n\r\nStuff like that is part of the form (validation/values), not the controller, so it'd be nice if the form could do that. Overriding `getFieldValues()`/`isValid()` isn't enough because that's not called for child forms and child child forms etc.\r\n\r\nI don't think there's another way to do both things (alter valid and alter values) currently."}}
{"actor":{"display_login":"rudiedirkx"}}