{"action":"created","issue":{"url":"https://api.github.com/repos/joomla/joomla-cms/issues/7372","labels_url":"https://api.github.com/repos/joomla/joomla-cms/issues/7372/labels{/name}","comments_url":"https://api.github.com/repos/joomla/joomla-cms/issues/7372/comments","events_url":"https://api.github.com/repos/joomla/joomla-cms/issues/7372/events","html_url":"https://github.com/joomla/joomla-cms/pull/7372","id":93628200,"number":7372,"title":"Fixed required multiple field which is empty","user":{"login":"bembelimen","id":1229869,"avatar_url":"https://avatars.githubusercontent.com/u/1229869?v=3","gravatar_id":"","url":"https://api.github.com/users/bembelimen","html_url":"https://github.com/bembelimen","followers_url":"https://api.github.com/users/bembelimen/followers","following_url":"https://api.github.com/users/bembelimen/following{/other_user}","gists_url":"https://api.github.com/users/bembelimen/gists{/gist_id}","starred_url":"https://api.github.com/users/bembelimen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bembelimen/subscriptions","organizations_url":"https://api.github.com/users/bembelimen/orgs","repos_url":"https://api.github.com/users/bembelimen/repos","events_url":"https://api.github.com/users/bembelimen/events{/privacy}","received_events_url":"https://api.github.com/users/bembelimen/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/joomla/joomla-cms/labels/PR-staging","name":"PR-staging","color":"c7def8"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":12,"created_at":"2015-07-07T21:01:29Z","updated_at":"2015-08-08T19:31:01Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/joomla/joomla-cms/pulls/7372","html_url":"https://github.com/joomla/joomla-cms/pull/7372","diff_url":"https://github.com/joomla/joomla-cms/pull/7372.diff","patch_url":"https://github.com/joomla/joomla-cms/pull/7372.patch"},"body":"If you submit an empty multiple field, the JForm::filter method set's the value to an array:\r\nhttps://github.com/joomla/joomla-cms/blob/staging/libraries/joomla/form/form.php#L251\r\nAnd now the JForm::validateField doesn't recognize it as empty:\r\nhttps://github.com/joomla/joomla-cms/blob/staging/libraries/joomla/form/form.php#L1962\r\n\r\nThe patch will fix that\r\n\r\nHow to test:\r\n\r\n- open the XML file administrator/components/com_content/models/forms/article.xml\r\n- add the following field: ```<field name=\"foobar\" multiple=\"true\" required=\"true\" />```\r\n- Create an article, add an title and try to save\r\n\r\nExpected result: Joomla! complains about the required field \"foobar\" (because we didn't send it)\r\nCurrent result: article could be saved\r\n\r\n- Apply path\r\n- try again"},"comment":{"url":"https://api.github.com/repos/joomla/joomla-cms/issues/comments/129040082","html_url":"https://github.com/joomla/joomla-cms/pull/7372#issuecomment-129040082","issue_url":"https://api.github.com/repos/joomla/joomla-cms/issues/7372","id":129040082,"user":{"login":"bembelimen","id":1229869,"avatar_url":"https://avatars.githubusercontent.com/u/1229869?v=3","gravatar_id":"","url":"https://api.github.com/users/bembelimen","html_url":"https://github.com/bembelimen","followers_url":"https://api.github.com/users/bembelimen/followers","following_url":"https://api.github.com/users/bembelimen/following{/other_user}","gists_url":"https://api.github.com/users/bembelimen/gists{/gist_id}","starred_url":"https://api.github.com/users/bembelimen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bembelimen/subscriptions","organizations_url":"https://api.github.com/users/bembelimen/orgs","repos_url":"https://api.github.com/users/bembelimen/repos","events_url":"https://api.github.com/users/bembelimen/events{/privacy}","received_events_url":"https://api.github.com/users/bembelimen/received_events","type":"User","site_admin":false},"created_at":"2015-08-08T19:31:01Z","updated_at":"2015-08-08T19:31:01Z","body":"@Fedik That \"strlen\" is a very good idea, thanks for that.\r\nI still think, an empty input field (array('')) is invalid, but yeah, some other opinions would be good."}}