{"action":"created","comment":{"url":"https://api.github.com/repos/joomla/joomla-cms/pulls/comments/134725197","pull_request_review_id":58049279,"id":134725197,"diff_hunk":"@@ -520,6 +535,10 @@ public function __set($name, $value)\n \t\t\t\t$this->$name = (int) $value;\n \t\t\t\tbreak;\n \n+\t\t\tcase $this->dataAttributeName = $this->dataAttributeName ? $this->dataAttributeName : '' === $name:\n+\t\t\t\t$this->dataAttributeValues[] = $name . '=\"' . htmlspecialchars($value, ENT_COMPAT, 'UTF-8') . '\"';","path":"libraries/joomla/form/field.php","position":null,"original_position":27,"commit_id":"26381205ba0a0cd5eaeb20e2e1dead17dcbf0169","original_commit_id":"656d0edb15a5ac38d06dd2405018f126fcb4bc8e","user":{"login":"nilesh-more","id":16605829,"avatar_url":"https://avatars2.githubusercontent.com/u/16605829?v=4","gravatar_id":"","url":"https://api.github.com/users/nilesh-more","html_url":"https://github.com/nilesh-more","followers_url":"https://api.github.com/users/nilesh-more/followers","following_url":"https://api.github.com/users/nilesh-more/following{/other_user}","gists_url":"https://api.github.com/users/nilesh-more/gists{/gist_id}","starred_url":"https://api.github.com/users/nilesh-more/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nilesh-more/subscriptions","organizations_url":"https://api.github.com/users/nilesh-more/orgs","repos_url":"https://api.github.com/users/nilesh-more/repos","events_url":"https://api.github.com/users/nilesh-more/events{/privacy}","received_events_url":"https://api.github.com/users/nilesh-more/received_events","type":"User","site_admin":false},"body":"@Fedik Please can you elaborate on what you mean by `it does not allow to override value for an existing data- attribute, from outside`, it will help me to troubleshoot","created_at":"2017-08-23T11:31:05Z","updated_at":"2017-08-23T11:31:05Z","html_url":"https://github.com/joomla/joomla-cms/pull/16141#discussion_r134725197","pull_request_url":"https://api.github.com/repos/joomla/joomla-cms/pulls/16141","_links":{"self":{"href":"https://api.github.com/repos/joomla/joomla-cms/pulls/comments/134725197"},"html":{"href":"https://github.com/joomla/joomla-cms/pull/16141#discussion_r134725197"},"pull_request":{"href":"https://api.github.com/repos/joomla/joomla-cms/pulls/16141"}}},"pull_request":{"url":"https://api.github.com/repos/joomla/joomla-cms/pulls/16141","id":121621273,"html_url":"https://github.com/joomla/joomla-cms/pull/16141","diff_url":"https://github.com/joomla/joomla-cms/pull/16141.diff","patch_url":"https://github.com/joomla/joomla-cms/pull/16141.patch","issue_url":"https://api.github.com/repos/joomla/joomla-cms/issues/16141","number":16141,"state":"open","locked":false,"title":"Issue #16034 feat: Allow jForm to support data attribute","user":{"login":"nilesh-more","id":16605829,"avatar_url":"https://avatars2.githubusercontent.com/u/16605829?v=4","gravatar_id":"","url":"https://api.github.com/users/nilesh-more","html_url":"https://github.com/nilesh-more","followers_url":"https://api.github.com/users/nilesh-more/followers","following_url":"https://api.github.com/users/nilesh-more/following{/other_user}","gists_url":"https://api.github.com/users/nilesh-more/gists{/gist_id}","starred_url":"https://api.github.com/users/nilesh-more/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nilesh-more/subscriptions","organizations_url":"https://api.github.com/users/nilesh-more/orgs","repos_url":"https://api.github.com/users/nilesh-more/repos","events_url":"https://api.github.com/users/nilesh-more/events{/privacy}","received_events_url":"https://api.github.com/users/nilesh-more/received_events","type":"User","site_admin":false},"body":"Pull Request for Issue #16034 \r\n\r\n### Summary of Changes\r\n- [HTML5](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5) is designed with extensibility in mind for data that should be associated with a particular element but need not have any defined meaning. data-* attributes allow us to store extra information on the standard, semantic HTML elements without other hacks such as non-standard attributes, extra properties on DOM.\r\n\r\n- However, custom attributes have no special meaning generally and are only special to the owner's application. They can be used to simplify an application's logic. By allowing JForm to support data attributes, it can be greatly aid development of extensions both core and third party.\r\n\r\n### Testing Instructions\r\n-  Add data attribute in XML form, for example\r\n     -  Open administrator/components/com_users/models/forms/user.xml file\r\n     -   Add data attribute in xml field, like\r\n          <pre><code> &lt;field name=\"name\" \r\n                 type=\"text\"\r\n\t             description=\"COM_USERS_USER_FIELD_NAME_DESC\"\r\n\t             label=\"COM_USERS_USER_FIELD_NAME_LABEL\"\r\n         \trequired=\"true\"\r\n                 size=\"30\"\r\n                 data-action-type=\"click\"  // add data attribute like this\r\n            /&gt;\r\n           </code ></pre>\r\n\r\n- Login into administrator\r\n- Click on menu Users => Manage => Add New User\r\n- Inspect the filed = *Name* and check input type html\r\n\r\n### Expected result\r\n  * Output should be like this \r\n      <pre><code> &lt;input type=\"text\" \r\n            name=\"jform[name]\" \r\n            id=\"jform_name\" \r\n            value=\"\" \r\n            class=\"required invalid\" \r\n            size=\"30\" \r\n            required=\"required\" \r\n            aria-required=\"true\" \r\n            data-action-type=\"click\"  // output \r\n            autocomplete=\"off\" \r\n            aria-invalid=\"true\"\r\n       /&gt;\r\n         </code ></pre>\r\n   * Output snapshot\r\n![screenshot from 2017-05-15 19 27 38](https://cloud.githubusercontent.com/assets/16605829/26061183/cf507526-39a4-11e7-8aa9-a7a562a006db.png)\r\n\r\n### Actual result\r\n\r\n* Added data attribute is missing in final output\r\n      <pre><code> &lt;input type=\"text\" \r\n                      name=\"jform[name]\" \r\n                      id=\"jform_name\" \r\n                      value=\"\" \r\n                      class=\"required invalid\" \r\n                      size=\"30\" \r\n                      required=\"required\" \r\n                     aria-required=\"true\" \r\n                     autocomplete=\"off\" \r\n                     aria-invalid=\"true\"\r\n       /&gt;\r\n         </code ></pre>\r\n\r\n\r\n### Documentation Changes Required\r\n\r\n","created_at":"2017-05-20T12:00:23Z","updated_at":"2017-08-23T11:31:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ca3327b9b381d742f052ddcf1847b2153804665c","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/joomla/joomla-cms/pulls/16141/commits","review_comments_url":"https://api.github.com/repos/joomla/joomla-cms/pulls/16141/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/16141/comments","statuses_url":"https://api.github.com/repos/joomla/joomla-cms/statuses/26381205ba0a0cd5eaeb20e2e1dead17dcbf0169","head":{"label":"nilesh-more:local-staging","ref":"local-staging","sha":"26381205ba0a0cd5eaeb20e2e1dead17dcbf0169","user":{"login":"nilesh-more","id":16605829,"avatar_url":"https://avatars2.githubusercontent.com/u/16605829?v=4","gravatar_id":"","url":"https://api.github.com/users/nilesh-more","html_url":"https://github.com/nilesh-more","followers_url":"https://api.github.com/users/nilesh-more/followers","following_url":"https://api.github.com/users/nilesh-more/following{/other_user}","gists_url":"https://api.github.com/users/nilesh-more/gists{/gist_id}","starred_url":"https://api.github.com/users/nilesh-more/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nilesh-more/subscriptions","organizations_url":"https://api.github.com/users/nilesh-more/orgs","repos_url":"https://api.github.com/users/nilesh-more/repos","events_url":"https://api.github.com/users/nilesh-more/events{/privacy}","received_events_url":"https://api.github.com/users/nilesh-more/received_events","type":"User","site_admin":false},"repo":{"id":62451733,"name":"joomla-cms","full_name":"nilesh-more/joomla-cms","owner":{"login":"nilesh-more","id":16605829,"avatar_url":"https://avatars2.githubusercontent.com/u/16605829?v=4","gravatar_id":"","url":"https://api.github.com/users/nilesh-more","html_url":"https://github.com/nilesh-more","followers_url":"https://api.github.com/users/nilesh-more/followers","following_url":"https://api.github.com/users/nilesh-more/following{/other_user}","gists_url":"https://api.github.com/users/nilesh-more/gists{/gist_id}","starred_url":"https://api.github.com/users/nilesh-more/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nilesh-more/subscriptions","organizations_url":"https://api.github.com/users/nilesh-more/orgs","repos_url":"https://api.github.com/users/nilesh-more/repos","events_url":"https://api.github.com/users/nilesh-more/events{/privacy}","received_events_url":"https://api.github.com/users/nilesh-more/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nilesh-more/joomla-cms","description":"Home of the Joomla! Content Management System","fork":true,"url":"https://api.github.com/repos/nilesh-more/joomla-cms","forks_url":"https://api.github.com/repos/nilesh-more/joomla-cms/forks","keys_url":"https://api.github.com/repos/nilesh-more/joomla-cms/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nilesh-more/joomla-cms/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nilesh-more/joomla-cms/teams","hooks_url":"https://api.github.com/repos/nilesh-more/joomla-cms/hooks","issue_events_url":"https://api.github.com/repos/nilesh-more/joomla-cms/issues/events{/number}","events_url":"https://api.github.com/repos/nilesh-more/joomla-cms/events","assignees_url":"https://api.github.com/repos/nilesh-more/joomla-cms/assignees{/user}","branches_url":"https://api.github.com/repos/nilesh-more/joomla-cms/branches{/branch}","tags_url":"https://api.github.com/repos/nilesh-more/joomla-cms/tags","blobs_url":"https://api.github.com/repos/nilesh-more/joomla-cms/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nilesh-more/joomla-cms/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nilesh-more/joomla-cms/git/refs{/sha}","trees_url":"https://api.github.com/repos/nilesh-more/joomla-cms/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nilesh-more/joomla-cms/statuses/{sha}","languages_url":"https://api.github.com/repos/nilesh-more/joomla-cms/languages","stargazers_url":"https://api.github.com/repos/nilesh-more/joomla-cms/stargazers","contributors_url":"https://api.github.com/repos/nilesh-more/joomla-cms/contributors","subscribers_url":"https://api.github.com/repos/nilesh-more/joomla-cms/subscribers","subscription_url":"https://api.github.com/repos/nilesh-more/joomla-cms/subscription","commits_url":"https://api.github.com/repos/nilesh-more/joomla-cms/commits{/sha}","git_commits_url":"https://api.github.com/repos/nilesh-more/joomla-cms/git/commits{/sha}","comments_url":"https://api.github.com/repos/nilesh-more/joomla-cms/comments{/number}","issue_comment_url":"https://api.github.com/repos/nilesh-more/joomla-cms/issues/comments{/number}","contents_url":"https://api.github.com/repos/nilesh-more/joomla-cms/contents/{+path}","compare_url":"https://api.github.com/repos/nilesh-more/joomla-cms/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nilesh-more/joomla-cms/merges","archive_url":"https://api.github.com/repos/nilesh-more/joomla-cms/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nilesh-more/joomla-cms/downloads","issues_url":"https://api.github.com/repos/nilesh-more/joomla-cms/issues{/number}","pulls_url":"https://api.github.com/repos/nilesh-more/joomla-cms/pulls{/number}","milestones_url":"https://api.github.com/repos/nilesh-more/joomla-cms/milestones{/number}","notifications_url":"https://api.github.com/repos/nilesh-more/joomla-cms/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nilesh-more/joomla-cms/labels{/name}","releases_url":"https://api.github.com/repos/nilesh-more/joomla-cms/releases{/id}","deployments_url":"https://api.github.com/repos/nilesh-more/joomla-cms/deployments","created_at":"2016-07-02T13:20:43Z","updated_at":"2016-07-02T13:20:57Z","pushed_at":"2017-08-07T10:58:10Z","git_url":"git://github.com/nilesh-more/joomla-cms.git","ssh_url":"git@github.com:nilesh-more/joomla-cms.git","clone_url":"https://github.com/nilesh-more/joomla-cms.git","svn_url":"https://github.com/nilesh-more/joomla-cms","homepage":"https://www.joomla.org","size":179136,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"staging"}},"base":{"label":"joomla:staging","ref":"staging","sha":"d3bb5a77d83c2ea7cf7f6f13ed133e879fb3ec94","user":{"login":"joomla","id":751633,"avatar_url":"https://avatars3.githubusercontent.com/u/751633?v=4","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://avatars3.githubusercontent.com/u/751633?v=4","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}","deployments_url":"https://api.github.com/repos/joomla/joomla-cms/deployments","created_at":"2011-09-27T02:07:38Z","updated_at":"2017-08-23T11:25:33Z","pushed_at":"2017-08-23T11:25:28Z","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":"https://www.joomla.org","size":203297,"stargazers_count":2461,"watchers_count":2461,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2536,"mirror_url":null,"open_issues_count":775,"forks":2536,"open_issues":775,"watchers":2461,"default_branch":"staging"}},"_links":{"self":{"href":"https://api.github.com/repos/joomla/joomla-cms/pulls/16141"},"html":{"href":"https://github.com/joomla/joomla-cms/pull/16141"},"issue":{"href":"https://api.github.com/repos/joomla/joomla-cms/issues/16141"},"comments":{"href":"https://api.github.com/repos/joomla/joomla-cms/issues/16141/comments"},"review_comments":{"href":"https://api.github.com/repos/joomla/joomla-cms/pulls/16141/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/16141/commits"},"statuses":{"href":"https://api.github.com/repos/joomla/joomla-cms/statuses/26381205ba0a0cd5eaeb20e2e1dead17dcbf0169"}}}}
{"actor":{"display_login":"nilesh-more"}}