{"action":"closed","number":7381,"pull_request":{"url":"https://api.github.com/repos/joomla/joomla-cms/pulls/7381","id":39474009,"html_url":"https://github.com/joomla/joomla-cms/pull/7381","diff_url":"https://github.com/joomla/joomla-cms/pull/7381.diff","patch_url":"https://github.com/joomla/joomla-cms/pull/7381.patch","issue_url":"https://api.github.com/repos/joomla/joomla-cms/issues/7381","number":7381,"state":"closed","locked":false,"title":"JForm::filter() make sure that $data is complete","user":{"login":"Fedik","id":1568198,"avatar_url":"https://avatars.githubusercontent.com/u/1568198?v=3","gravatar_id":"","url":"https://api.github.com/users/Fedik","html_url":"https://github.com/Fedik","followers_url":"https://api.github.com/users/Fedik/followers","following_url":"https://api.github.com/users/Fedik/following{/other_user}","gists_url":"https://api.github.com/users/Fedik/gists{/gist_id}","starred_url":"https://api.github.com/users/Fedik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Fedik/subscriptions","organizations_url":"https://api.github.com/users/Fedik/orgs","repos_url":"https://api.github.com/users/Fedik/repos","events_url":"https://api.github.com/users/Fedik/events{/privacy}","received_events_url":"https://api.github.com/users/Fedik/received_events","type":"User","site_admin":false},"body":"As I have got a \"loot positive\" feedbacks [there](https://groups.google.com/forum/#!topic/joomla-dev-cms/lwvSE4c6W94) I have decided to make this pull :sweat_smile: \r\n\r\nSo, here is revert #2617, and fix for #7316 and #7372, and alternative fix for #2617 \r\n\r\nCurrently `JForm` do not check when the Browser do not submit the value for some inputs, due specific behavior of these input types (checkbox(es), multiple select) or because field was removed by User by editing HTML.\r\n\r\nThis patch force `JForm::filter()` to check whether submitted data has all inputs.\r\n\r\n**test**\r\nApply patch.\r\nAdd to the `templates/protostar/templateDetails.xml` next fields (after `<fieldset name=\"advanced\">`):\r\n```xml\r\n<field type=\"checkbox\" name=\"checkbox\" label=\"Checkbox\" />\r\n<field type=\"checkboxes\" name=\"checkboxes\" label=\"Checkboxes\" >\r\n\t<option value=\"1\">1</option>\r\n\t<option value=\"2\">2</option>\r\n\t<option value=\"text\">text</option>\r\n</field>\r\n<field type=\"list\" name=\"list\" label=\"List\" multiple=\"true\" >\r\n\t<option value=\"1\">1</option>\r\n\t<option value=\"2\">2</option>\r\n\t<option value=\"text\">text</option>\r\n</field>\r\n```\r\nThen open `libraries/joomla/form/form.php` and in line 250 (before \"return\") add:\r\n```php\r\n$d = $output->toArray();\r\necho '<pre>';\r\nvar_dump($d['params']);\r\necho '</pre>';\r\nexit;\r\n```\r\nThen go to edit Protostar template parameters, leave all custom fields empty and push save.\r\n\r\n**Before patch**\r\nYou get:\r\n```php\r\narray (size=8)\r\n  'checkboxes' => array()\r\n  'list' => array()\r\n  'templateColor' => string '#0088cc' (length=7)\r\n  'templateBackgroundColor' => string '#f4f6f7' (length=7)\r\n  'logoFile' => string '' (length=0)\r\n  'sitetitle' => string '' (length=0)\r\n  'sitedescription' => string '' (length=0)\r\n  'googleFont' => string '1' (length=1)\r\n  'googleFontName' => string 'Open+Sans' (length=9)\r\n  'fluidContainer' => string '0' (length=1)\r\n```\r\n~~Means custom fields was not submitted and so, not available. (Joomla <= 3.4.1)~~\r\nUpd (Joomla >= 3.4.2): Here single `checkbox` is missed, and multiple fields has `array` value that is wrong, because it is cause the validation problem, and the problem with loading the default value when use `Registry`.\r\n\r\n**After patch**\r\nYou should get:\r\n```php\r\narray (size=11)\r\n  'checkbox' => null\r\n  'checkboxes' => null\r\n  'list' => null\r\n  'templateColor' => string '#0088cc' (length=7)\r\n  'templateBackgroundColor' => string '#f4f6f7' (length=7)\r\n  'logoFile' => string '' (length=0)\r\n  'sitetitle' => string '' (length=0)\r\n  'sitedescription' => string '' (length=0)\r\n  'googleFont' => string '1' (length=1)\r\n  'googleFontName' => string 'Open+Sans' (length=9)\r\n  'fluidContainer' => string '0' (length=1)\r\n```\r\n\r\nNow all fields available in data, and unchecked checkboxes has \"empty\" values.","created_at":"2015-07-08T13:00:50Z","updated_at":"2015-09-01T18:26:27Z","closed_at":"2015-09-01T18:26:27Z","merged_at":"2015-09-01T18:26:27Z","merge_commit_sha":"be8de769049ff18e5731f4a2c4d0f816ca297012","assignee":null,"milestone":{"url":"https://api.github.com/repos/joomla/joomla-cms/milestones/10","html_url":"https://github.com/joomla/joomla-cms/milestones/Joomla!%203.4.4","labels_url":"https://api.github.com/repos/joomla/joomla-cms/milestones/10/labels","id":1190334,"number":10,"title":"Joomla! 3.4.4","description":"","creator":{"login":"zero-24","id":2596554,"avatar_url":"https://avatars.githubusercontent.com/u/2596554?v=3","gravatar_id":"","url":"https://api.github.com/users/zero-24","html_url":"https://github.com/zero-24","followers_url":"https://api.github.com/users/zero-24/followers","following_url":"https://api.github.com/users/zero-24/following{/other_user}","gists_url":"https://api.github.com/users/zero-24/gists{/gist_id}","starred_url":"https://api.github.com/users/zero-24/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zero-24/subscriptions","organizations_url":"https://api.github.com/users/zero-24/orgs","repos_url":"https://api.github.com/users/zero-24/repos","events_url":"https://api.github.com/users/zero-24/events{/privacy}","received_events_url":"https://api.github.com/users/zero-24/received_events","type":"User","site_admin":false},"open_issues":14,"closed_issues":237,"state":"open","created_at":"2015-07-02T09:44:31Z","updated_at":"2015-09-01T18:26:27Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/joomla/joomla-cms/pulls/7381/commits","review_comments_url":"https://api.github.com/repos/joomla/joomla-cms/pulls/7381/comments","review_comment_url":"https://api.github.com/repos/joomla/joomla-cms/pulls/comments{/number}","comments_url":"https://api.github.com/repos/joomla/joomla-cms/issues/7381/comments","statuses_url":"https://api.github.com/repos/joomla/joomla-cms/statuses/f4d2941c5cd9395f6040696d13ab9c636a7e8099","head":{"label":"Fedik:jform-filter-completedata","ref":"jform-filter-completedata","sha":"f4d2941c5cd9395f6040696d13ab9c636a7e8099","user":{"login":"Fedik","id":1568198,"avatar_url":"https://avatars.githubusercontent.com/u/1568198?v=3","gravatar_id":"","url":"https://api.github.com/users/Fedik","html_url":"https://github.com/Fedik","followers_url":"https://api.github.com/users/Fedik/followers","following_url":"https://api.github.com/users/Fedik/following{/other_user}","gists_url":"https://api.github.com/users/Fedik/gists{/gist_id}","starred_url":"https://api.github.com/users/Fedik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Fedik/subscriptions","organizations_url":"https://api.github.com/users/Fedik/orgs","repos_url":"https://api.github.com/users/Fedik/repos","events_url":"https://api.github.com/users/Fedik/events{/privacy}","received_events_url":"https://api.github.com/users/Fedik/received_events","type":"User","site_admin":false},"repo":{"id":7179494,"name":"joomla-cms","full_name":"Fedik/joomla-cms","owner":{"login":"Fedik","id":1568198,"avatar_url":"https://avatars.githubusercontent.com/u/1568198?v=3","gravatar_id":"","url":"https://api.github.com/users/Fedik","html_url":"https://github.com/Fedik","followers_url":"https://api.github.com/users/Fedik/followers","following_url":"https://api.github.com/users/Fedik/following{/other_user}","gists_url":"https://api.github.com/users/Fedik/gists{/gist_id}","starred_url":"https://api.github.com/users/Fedik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Fedik/subscriptions","organizations_url":"https://api.github.com/users/Fedik/orgs","repos_url":"https://api.github.com/users/Fedik/repos","events_url":"https://api.github.com/users/Fedik/events{/privacy}","received_events_url":"https://api.github.com/users/Fedik/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Fedik/joomla-cms","description":"Home of the Joomla! Content Management System","fork":true,"url":"https://api.github.com/repos/Fedik/joomla-cms","forks_url":"https://api.github.com/repos/Fedik/joomla-cms/forks","keys_url":"https://api.github.com/repos/Fedik/joomla-cms/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Fedik/joomla-cms/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Fedik/joomla-cms/teams","hooks_url":"https://api.github.com/repos/Fedik/joomla-cms/hooks","issue_events_url":"https://api.github.com/repos/Fedik/joomla-cms/issues/events{/number}","events_url":"https://api.github.com/repos/Fedik/joomla-cms/events","assignees_url":"https://api.github.com/repos/Fedik/joomla-cms/assignees{/user}","branches_url":"https://api.github.com/repos/Fedik/joomla-cms/branches{/branch}","tags_url":"https://api.github.com/repos/Fedik/joomla-cms/tags","blobs_url":"https://api.github.com/repos/Fedik/joomla-cms/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Fedik/joomla-cms/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Fedik/joomla-cms/git/refs{/sha}","trees_url":"https://api.github.com/repos/Fedik/joomla-cms/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Fedik/joomla-cms/statuses/{sha}","languages_url":"https://api.github.com/repos/Fedik/joomla-cms/languages","stargazers_url":"https://api.github.com/repos/Fedik/joomla-cms/stargazers","contributors_url":"https://api.github.com/repos/Fedik/joomla-cms/contributors","subscribers_url":"https://api.github.com/repos/Fedik/joomla-cms/subscribers","subscription_url":"https://api.github.com/repos/Fedik/joomla-cms/subscription","commits_url":"https://api.github.com/repos/Fedik/joomla-cms/commits{/sha}","git_commits_url":"https://api.github.com/repos/Fedik/joomla-cms/git/commits{/sha}","comments_url":"https://api.github.com/repos/Fedik/joomla-cms/comments{/number}","issue_comment_url":"https://api.github.com/repos/Fedik/joomla-cms/issues/comments{/number}","contents_url":"https://api.github.com/repos/Fedik/joomla-cms/contents/{+path}","compare_url":"https://api.github.com/repos/Fedik/joomla-cms/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Fedik/joomla-cms/merges","archive_url":"https://api.github.com/repos/Fedik/joomla-cms/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Fedik/joomla-cms/downloads","issues_url":"https://api.github.com/repos/Fedik/joomla-cms/issues{/number}","pulls_url":"https://api.github.com/repos/Fedik/joomla-cms/pulls{/number}","milestones_url":"https://api.github.com/repos/Fedik/joomla-cms/milestones{/number}","notifications_url":"https://api.github.com/repos/Fedik/joomla-cms/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Fedik/joomla-cms/labels{/name}","releases_url":"https://api.github.com/repos/Fedik/joomla-cms/releases{/id}","created_at":"2012-12-15T13:09:18Z","updated_at":"2015-05-06T16:46:20Z","pushed_at":"2015-08-30T14:35:08Z","git_url":"git://github.com/Fedik/joomla-cms.git","ssh_url":"git@github.com:Fedik/joomla-cms.git","clone_url":"https://github.com/Fedik/joomla-cms.git","svn_url":"https://github.com/Fedik/joomla-cms","homepage":"http://joomla.org","size":134328,"stargazers_count":1,"watchers_count":1,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"joomla:staging","ref":"staging","sha":"2f76e54df9f76b2cfd2cae71edc0184b75a1a149","user":{"login":"joomla","id":751633,"avatar_url":"https://avatars.githubusercontent.com/u/751633?v=3","gravatar_id":"","url":"https://api.github.com/users/joomla","html_url":"https://github.com/joomla","followers_url":"https://api.github.com/users/joomla/followers","following_url":"https://api.github.com/users/joomla/following{/other_user}","gists_url":"https://api.github.com/users/joomla/gists{/gist_id}","starred_url":"https://api.github.com/users/joomla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joomla/subscriptions","organizations_url":"https://api.github.com/users/joomla/orgs","repos_url":"https://api.github.com/users/joomla/repos","events_url":"https://api.github.com/users/joomla/events{/privacy}","received_events_url":"https://api.github.com/users/joomla/received_events","type":"Organization","site_admin":false},"repo":{"id":2464908,"name":"joomla-cms","full_name":"joomla/joomla-cms","owner":{"login":"joomla","id":751633,"avatar_url":"https://avatars.githubusercontent.com/u/751633?v=3","gravatar_id":"","url":"https://api.github.com/users/joomla","html_url":"https://github.com/joomla","followers_url":"https://api.github.com/users/joomla/followers","following_url":"https://api.github.com/users/joomla/following{/other_user}","gists_url":"https://api.github.com/users/joomla/gists{/gist_id}","starred_url":"https://api.github.com/users/joomla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joomla/subscriptions","organizations_url":"https://api.github.com/users/joomla/orgs","repos_url":"https://api.github.com/users/joomla/repos","events_url":"https://api.github.com/users/joomla/events{/privacy}","received_events_url":"https://api.github.com/users/joomla/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/joomla/joomla-cms","description":"Home of the Joomla! Content Management System","fork":false,"url":"https://api.github.com/repos/joomla/joomla-cms","forks_url":"https://api.github.com/repos/joomla/joomla-cms/forks","keys_url":"https://api.github.com/repos/joomla/joomla-cms/keys{/key_id}","collaborators_url":"https://api.github.com/repos/joomla/joomla-cms/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/joomla/joomla-cms/teams","hooks_url":"https://api.github.com/repos/joomla/joomla-cms/hooks","issue_events_url":"https://api.github.com/repos/joomla/joomla-cms/issues/events{/number}","events_url":"https://api.github.com/repos/joomla/joomla-cms/events","assignees_url":"https://api.github.com/repos/joomla/joomla-cms/assignees{/user}","branches_url":"https://api.github.com/repos/joomla/joomla-cms/branches{/branch}","tags_url":"https://api.github.com/repos/joomla/joomla-cms/tags","blobs_url":"https://api.github.com/repos/joomla/joomla-cms/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/joomla/joomla-cms/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/joomla/joomla-cms/git/refs{/sha}","trees_url":"https://api.github.com/repos/joomla/joomla-cms/git/trees{/sha}","statuses_url":"https://api.github.com/repos/joomla/joomla-cms/statuses/{sha}","languages_url":"https://api.github.com/repos/joomla/joomla-cms/languages","stargazers_url":"https://api.github.com/repos/joomla/joomla-cms/stargazers","contributors_url":"https://api.github.com/repos/joomla/joomla-cms/contributors","subscribers_url":"https://api.github.com/repos/joomla/joomla-cms/subscribers","subscription_url":"https://api.github.com/repos/joomla/joomla-cms/subscription","commits_url":"https://api.github.com/repos/joomla/joomla-cms/commits{/sha}","git_commits_url":"https://api.github.com/repos/joomla/joomla-cms/git/commits{/sha}","comments_url":"https://api.github.com/repos/joomla/joomla-cms/comments{/number}","issue_comment_url":"https://api.github.com/repos/joomla/joomla-cms/issues/comments{/number}","contents_url":"https://api.github.com/repos/joomla/joomla-cms/contents/{+path}","compare_url":"https://api.github.com/repos/joomla/joomla-cms/compare/{base}...{head}","merges_url":"https://api.github.com/repos/joomla/joomla-cms/merges","archive_url":"https://api.github.com/repos/joomla/joomla-cms/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/joomla/joomla-cms/downloads","issues_url":"https://api.github.com/repos/joomla/joomla-cms/issues{/number}","pulls_url":"https://api.github.com/repos/joomla/joomla-cms/pulls{/number}","milestones_url":"https://api.github.com/repos/joomla/joomla-cms/milestones{/number}","notifications_url":"https://api.github.com/repos/joomla/joomla-cms/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/joomla/joomla-cms/labels{/name}","releases_url":"https://api.github.com/repos/joomla/joomla-cms/releases{/id}","created_at":"2011-09-27T02:07:38Z","updated_at":"2015-09-01T13:29:57Z","pushed_at":"2015-09-01T18:26:27Z","git_url":"git://github.com/joomla/joomla-cms.git","ssh_url":"git@github.com:joomla/joomla-cms.git","clone_url":"https://github.com/joomla/joomla-cms.git","svn_url":"https://github.com/joomla/joomla-cms","homepage":"http://joomla.org","size":335658,"stargazers_count":1635,"watchers_count":1635,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1836,"mirror_url":null,"open_issues_count":548,"forks":1836,"open_issues":548,"watchers":1635,"default_branch":"staging"}},"_links":{"self":{"href":"https://api.github.com/repos/joomla/joomla-cms/pulls/7381"},"html":{"href":"https://github.com/joomla/joomla-cms/pull/7381"},"issue":{"href":"https://api.github.com/repos/joomla/joomla-cms/issues/7381"},"comments":{"href":"https://api.github.com/repos/joomla/joomla-cms/issues/7381/comments"},"review_comments":{"href":"https://api.github.com/repos/joomla/joomla-cms/pulls/7381/comments"},"review_comment":{"href":"https://api.github.com/repos/joomla/joomla-cms/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/joomla/joomla-cms/pulls/7381/commits"},"statuses":{"href":"https://api.github.com/repos/joomla/joomla-cms/statuses/f4d2941c5cd9395f6040696d13ab9c636a7e8099"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"Kubik-Rubik","id":1976103,"avatar_url":"https://avatars.githubusercontent.com/u/1976103?v=3","gravatar_id":"","url":"https://api.github.com/users/Kubik-Rubik","html_url":"https://github.com/Kubik-Rubik","followers_url":"https://api.github.com/users/Kubik-Rubik/followers","following_url":"https://api.github.com/users/Kubik-Rubik/following{/other_user}","gists_url":"https://api.github.com/users/Kubik-Rubik/gists{/gist_id}","starred_url":"https://api.github.com/users/Kubik-Rubik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kubik-Rubik/subscriptions","organizations_url":"https://api.github.com/users/Kubik-Rubik/orgs","repos_url":"https://api.github.com/users/Kubik-Rubik/repos","events_url":"https://api.github.com/users/Kubik-Rubik/events{/privacy}","received_events_url":"https://api.github.com/users/Kubik-Rubik/received_events","type":"User","site_admin":false},"comments":5,"review_comments":0,"commits":1,"additions":2,"deletions":8,"changed_files":1}}