{"action":"created","comment":{"url":"https://api.github.com/repos/silverstripe/silverstripe-framework/pulls/comments/53983380","id":53983380,"diff_hunk":"@@ -1842,31 +1860,35 @@ public function __construct() {\n \t * @return bool Returns TRUE if the submitted data is valid, otherwise\n \t *              FALSE.\n \t */\n-\tpublic function php($data) {\n+\tpublic function php($data)\n+\t{\n \t\t$valid = parent::php($data);\n \n-\t\t$identifierField = Member::config()->unique_identifier_field;\n-\t\t$member = DataObject::get_one('Member', array(\n-\t\t\t\"\\\"$identifierField\\\"\" => $data[$identifierField]\n-\t\t));\n+\t\t$identifierField = (string)Member::config()->unique_identifier_field;\n \n-\t\t// if we are in a complex table field popup, use ctf[childID], else use ID\n-\t\tif(isset($_REQUEST['ctf']['childID'])) {\n-\t\t\t$id = $_REQUEST['ctf']['childID'];\n-\t\t} elseif(isset($_REQUEST['ID'])) {\n-\t\t\t$id = $_REQUEST['ID'];\n-\t\t} else {\n-\t\t\t$id = null;\n+\t\t$id = isset($data['ID']) ? (int)$data['ID'] : 0;\n+\t\tif(!$id && ($ctrl = $this->form->getController())){\n+\t\t\t// get the record when within GridField (Member editing page in CMS)\n+\t\t\tif($ctrl instanceof GridFieldDetailForm_ItemRequest && $record = $ctrl->getRecord()){\n+\t\t\t\t$id = $record->ID;\n+\t\t\t\t// set the ID to the data array, so that extensions can also use it\n+\t\t\t\t$data['ID'] = $id;\n+\t\t\t}\n+\t\t}\n+\n+\t\t$members = Member::get()->filter($identifierField, $data[$identifierField]);","path":"security/Member.php","position":87,"original_position":87,"commit_id":"f2e4fa3682832bff2deb6fdfd2a26b262100718b","original_commit_id":"f2e4fa3682832bff2deb6fdfd2a26b262100718b","user":{"login":"dhensby","id":563596,"avatar_url":"https://avatars.githubusercontent.com/u/563596?v=3","gravatar_id":"","url":"https://api.github.com/users/dhensby","html_url":"https://github.com/dhensby","followers_url":"https://api.github.com/users/dhensby/followers","following_url":"https://api.github.com/users/dhensby/following{/other_user}","gists_url":"https://api.github.com/users/dhensby/gists{/gist_id}","starred_url":"https://api.github.com/users/dhensby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dhensby/subscriptions","organizations_url":"https://api.github.com/users/dhensby/orgs","repos_url":"https://api.github.com/users/dhensby/repos","events_url":"https://api.github.com/users/dhensby/events{/privacy}","received_events_url":"https://api.github.com/users/dhensby/received_events","type":"User","site_admin":false},"body":"No. You can just amend this PR and force push. The updates will come into the PR automatically ","created_at":"2016-02-24T18:31:26Z","updated_at":"2016-02-24T18:31:26Z","html_url":"https://github.com/silverstripe/silverstripe-framework/pull/5091#discussion_r53983380","pull_request_url":"https://api.github.com/repos/silverstripe/silverstripe-framework/pulls/5091","_links":{"self":{"href":"https://api.github.com/repos/silverstripe/silverstripe-framework/pulls/comments/53983380"},"html":{"href":"https://github.com/silverstripe/silverstripe-framework/pull/5091#discussion_r53983380"},"pull_request":{"href":"https://api.github.com/repos/silverstripe/silverstripe-framework/pulls/5091"}}},"pull_request":{"url":"https://api.github.com/repos/silverstripe/silverstripe-framework/pulls/5091","id":60500761,"html_url":"https://github.com/silverstripe/silverstripe-framework/pull/5091","diff_url":"https://github.com/silverstripe/silverstripe-framework/pull/5091.diff","patch_url":"https://github.com/silverstripe/silverstripe-framework/pull/5091.patch","issue_url":"https://api.github.com/repos/silverstripe/silverstripe-framework/issues/5091","number":5091,"state":"open","locked":false,"title":"Fix for issue #5086","user":{"login":"bummzack","id":1006185,"avatar_url":"https://avatars.githubusercontent.com/u/1006185?v=3","gravatar_id":"","url":"https://api.github.com/users/bummzack","html_url":"https://github.com/bummzack","followers_url":"https://api.github.com/users/bummzack/followers","following_url":"https://api.github.com/users/bummzack/following{/other_user}","gists_url":"https://api.github.com/users/bummzack/gists{/gist_id}","starred_url":"https://api.github.com/users/bummzack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bummzack/subscriptions","organizations_url":"https://api.github.com/users/bummzack/orgs","repos_url":"https://api.github.com/users/bummzack/repos","events_url":"https://api.github.com/users/bummzack/events{/privacy}","received_events_url":"https://api.github.com/users/bummzack/received_events","type":"User","site_admin":false},"body":"Improve `Member_Validator` to:\r\n- properly check for existing members.\r\n- allow extensions.\r\n- remove old code and replace with new syntax and add config API.\r\n\r\nFix issue in Group code where Member_Validator was instantiated via \"new\" which didn't allow injector overrides.\r\nAdded unit-tests.","created_at":"2016-02-24T12:24:58Z","updated_at":"2016-02-24T18:31:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9fc8777b2dadee3c0fbc2a496a57292a8bc7dab2","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/silverstripe/silverstripe-framework/pulls/5091/commits","review_comments_url":"https://api.github.com/repos/silverstripe/silverstripe-framework/pulls/5091/comments","review_comment_url":"https://api.github.com/repos/silverstripe/silverstripe-framework/pulls/comments{/number}","comments_url":"https://api.github.com/repos/silverstripe/silverstripe-framework/issues/5091/comments","statuses_url":"https://api.github.com/repos/silverstripe/silverstripe-framework/statuses/f2e4fa3682832bff2deb6fdfd2a26b262100718b","head":{"label":"bummzack:5086-fix-member-validator","ref":"5086-fix-member-validator","sha":"f2e4fa3682832bff2deb6fdfd2a26b262100718b","user":{"login":"bummzack","id":1006185,"avatar_url":"https://avatars.githubusercontent.com/u/1006185?v=3","gravatar_id":"","url":"https://api.github.com/users/bummzack","html_url":"https://github.com/bummzack","followers_url":"https://api.github.com/users/bummzack/followers","following_url":"https://api.github.com/users/bummzack/following{/other_user}","gists_url":"https://api.github.com/users/bummzack/gists{/gist_id}","starred_url":"https://api.github.com/users/bummzack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bummzack/subscriptions","organizations_url":"https://api.github.com/users/bummzack/orgs","repos_url":"https://api.github.com/users/bummzack/repos","events_url":"https://api.github.com/users/bummzack/events{/privacy}","received_events_url":"https://api.github.com/users/bummzack/received_events","type":"User","site_admin":false},"repo":{"id":5955600,"name":"silverstripe-framework","full_name":"bummzack/silverstripe-framework","owner":{"login":"bummzack","id":1006185,"avatar_url":"https://avatars.githubusercontent.com/u/1006185?v=3","gravatar_id":"","url":"https://api.github.com/users/bummzack","html_url":"https://github.com/bummzack","followers_url":"https://api.github.com/users/bummzack/followers","following_url":"https://api.github.com/users/bummzack/following{/other_user}","gists_url":"https://api.github.com/users/bummzack/gists{/gist_id}","starred_url":"https://api.github.com/users/bummzack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bummzack/subscriptions","organizations_url":"https://api.github.com/users/bummzack/orgs","repos_url":"https://api.github.com/users/bummzack/repos","events_url":"https://api.github.com/users/bummzack/events{/privacy}","received_events_url":"https://api.github.com/users/bummzack/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bummzack/silverstripe-framework","description":"SilverStripe's Sapphire Framework","fork":true,"url":"https://api.github.com/repos/bummzack/silverstripe-framework","forks_url":"https://api.github.com/repos/bummzack/silverstripe-framework/forks","keys_url":"https://api.github.com/repos/bummzack/silverstripe-framework/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bummzack/silverstripe-framework/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bummzack/silverstripe-framework/teams","hooks_url":"https://api.github.com/repos/bummzack/silverstripe-framework/hooks","issue_events_url":"https://api.github.com/repos/bummzack/silverstripe-framework/issues/events{/number}","events_url":"https://api.github.com/repos/bummzack/silverstripe-framework/events","assignees_url":"https://api.github.com/repos/bummzack/silverstripe-framework/assignees{/user}","branches_url":"https://api.github.com/repos/bummzack/silverstripe-framework/branches{/branch}","tags_url":"https://api.github.com/repos/bummzack/silverstripe-framework/tags","blobs_url":"https://api.github.com/repos/bummzack/silverstripe-framework/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bummzack/silverstripe-framework/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bummzack/silverstripe-framework/git/refs{/sha}","trees_url":"https://api.github.com/repos/bummzack/silverstripe-framework/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bummzack/silverstripe-framework/statuses/{sha}","languages_url":"https://api.github.com/repos/bummzack/silverstripe-framework/languages","stargazers_url":"https://api.github.com/repos/bummzack/silverstripe-framework/stargazers","contributors_url":"https://api.github.com/repos/bummzack/silverstripe-framework/contributors","subscribers_url":"https://api.github.com/repos/bummzack/silverstripe-framework/subscribers","subscription_url":"https://api.github.com/repos/bummzack/silverstripe-framework/subscription","commits_url":"https://api.github.com/repos/bummzack/silverstripe-framework/commits{/sha}","git_commits_url":"https://api.github.com/repos/bummzack/silverstripe-framework/git/commits{/sha}","comments_url":"https://api.github.com/repos/bummzack/silverstripe-framework/comments{/number}","issue_comment_url":"https://api.github.com/repos/bummzack/silverstripe-framework/issues/comments{/number}","contents_url":"https://api.github.com/repos/bummzack/silverstripe-framework/contents/{+path}","compare_url":"https://api.github.com/repos/bummzack/silverstripe-framework/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bummzack/silverstripe-framework/merges","archive_url":"https://api.github.com/repos/bummzack/silverstripe-framework/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bummzack/silverstripe-framework/downloads","issues_url":"https://api.github.com/repos/bummzack/silverstripe-framework/issues{/number}","pulls_url":"https://api.github.com/repos/bummzack/silverstripe-framework/pulls{/number}","milestones_url":"https://api.github.com/repos/bummzack/silverstripe-framework/milestones{/number}","notifications_url":"https://api.github.com/repos/bummzack/silverstripe-framework/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bummzack/silverstripe-framework/labels{/name}","releases_url":"https://api.github.com/repos/bummzack/silverstripe-framework/releases{/id}","deployments_url":"https://api.github.com/repos/bummzack/silverstripe-framework/deployments","created_at":"2012-09-25T19:44:16Z","updated_at":"2016-01-13T07:10:16Z","pushed_at":"2016-02-24T12:23:56Z","git_url":"git://github.com/bummzack/silverstripe-framework.git","ssh_url":"git@github.com:bummzack/silverstripe-framework.git","clone_url":"https://github.com/bummzack/silverstripe-framework.git","svn_url":"https://github.com/bummzack/silverstripe-framework","homepage":"http://silverstripe.org/","size":53881,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"3.0"}},"base":{"label":"silverstripe:3.3","ref":"3.3","sha":"5f2d3f31d792227ec55f4ae27582ff9ff8cbdb4b","user":{"login":"silverstripe","id":379348,"avatar_url":"https://avatars.githubusercontent.com/u/379348?v=3","gravatar_id":"","url":"https://api.github.com/users/silverstripe","html_url":"https://github.com/silverstripe","followers_url":"https://api.github.com/users/silverstripe/followers","following_url":"https://api.github.com/users/silverstripe/following{/other_user}","gists_url":"https://api.github.com/users/silverstripe/gists{/gist_id}","starred_url":"https://api.github.com/users/silverstripe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/silverstripe/subscriptions","organizations_url":"https://api.github.com/users/silverstripe/orgs","repos_url":"https://api.github.com/users/silverstripe/repos","events_url":"https://api.github.com/users/silverstripe/events{/privacy}","received_events_url":"https://api.github.com/users/silverstripe/received_events","type":"Organization","site_admin":false},"repo":{"id":1318892,"name":"silverstripe-framework","full_name":"silverstripe/silverstripe-framework","owner":{"login":"silverstripe","id":379348,"avatar_url":"https://avatars.githubusercontent.com/u/379348?v=3","gravatar_id":"","url":"https://api.github.com/users/silverstripe","html_url":"https://github.com/silverstripe","followers_url":"https://api.github.com/users/silverstripe/followers","following_url":"https://api.github.com/users/silverstripe/following{/other_user}","gists_url":"https://api.github.com/users/silverstripe/gists{/gist_id}","starred_url":"https://api.github.com/users/silverstripe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/silverstripe/subscriptions","organizations_url":"https://api.github.com/users/silverstripe/orgs","repos_url":"https://api.github.com/users/silverstripe/repos","events_url":"https://api.github.com/users/silverstripe/events{/privacy}","received_events_url":"https://api.github.com/users/silverstripe/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/silverstripe/silverstripe-framework","description":"SilverStripe Framework, the MVC framework that powers SilverStripe CMS","fork":false,"url":"https://api.github.com/repos/silverstripe/silverstripe-framework","forks_url":"https://api.github.com/repos/silverstripe/silverstripe-framework/forks","keys_url":"https://api.github.com/repos/silverstripe/silverstripe-framework/keys{/key_id}","collaborators_url":"https://api.github.com/repos/silverstripe/silverstripe-framework/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/silverstripe/silverstripe-framework/teams","hooks_url":"https://api.github.com/repos/silverstripe/silverstripe-framework/hooks","issue_events_url":"https://api.github.com/repos/silverstripe/silverstripe-framework/issues/events{/number}","events_url":"https://api.github.com/repos/silverstripe/silverstripe-framework/events","assignees_url":"https://api.github.com/repos/silverstripe/silverstripe-framework/assignees{/user}","branches_url":"https://api.github.com/repos/silverstripe/silverstripe-framework/branches{/branch}","tags_url":"https://api.github.com/repos/silverstripe/silverstripe-framework/tags","blobs_url":"https://api.github.com/repos/silverstripe/silverstripe-framework/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/silverstripe/silverstripe-framework/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/silverstripe/silverstripe-framework/git/refs{/sha}","trees_url":"https://api.github.com/repos/silverstripe/silverstripe-framework/git/trees{/sha}","statuses_url":"https://api.github.com/repos/silverstripe/silverstripe-framework/statuses/{sha}","languages_url":"https://api.github.com/repos/silverstripe/silverstripe-framework/languages","stargazers_url":"https://api.github.com/repos/silverstripe/silverstripe-framework/stargazers","contributors_url":"https://api.github.com/repos/silverstripe/silverstripe-framework/contributors","subscribers_url":"https://api.github.com/repos/silverstripe/silverstripe-framework/subscribers","subscription_url":"https://api.github.com/repos/silverstripe/silverstripe-framework/subscription","commits_url":"https://api.github.com/repos/silverstripe/silverstripe-framework/commits{/sha}","git_commits_url":"https://api.github.com/repos/silverstripe/silverstripe-framework/git/commits{/sha}","comments_url":"https://api.github.com/repos/silverstripe/silverstripe-framework/comments{/number}","issue_comment_url":"https://api.github.com/repos/silverstripe/silverstripe-framework/issues/comments{/number}","contents_url":"https://api.github.com/repos/silverstripe/silverstripe-framework/contents/{+path}","compare_url":"https://api.github.com/repos/silverstripe/silverstripe-framework/compare/{base}...{head}","merges_url":"https://api.github.com/repos/silverstripe/silverstripe-framework/merges","archive_url":"https://api.github.com/repos/silverstripe/silverstripe-framework/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/silverstripe/silverstripe-framework/downloads","issues_url":"https://api.github.com/repos/silverstripe/silverstripe-framework/issues{/number}","pulls_url":"https://api.github.com/repos/silverstripe/silverstripe-framework/pulls{/number}","milestones_url":"https://api.github.com/repos/silverstripe/silverstripe-framework/milestones{/number}","notifications_url":"https://api.github.com/repos/silverstripe/silverstripe-framework/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/silverstripe/silverstripe-framework/labels{/name}","releases_url":"https://api.github.com/repos/silverstripe/silverstripe-framework/releases{/id}","deployments_url":"https://api.github.com/repos/silverstripe/silverstripe-framework/deployments","created_at":"2011-02-02T02:04:13Z","updated_at":"2016-02-16T10:56:53Z","pushed_at":"2016-02-24T17:20:09Z","git_url":"git://github.com/silverstripe/silverstripe-framework.git","ssh_url":"git@github.com:silverstripe/silverstripe-framework.git","clone_url":"https://github.com/silverstripe/silverstripe-framework.git","svn_url":"https://github.com/silverstripe/silverstripe-framework","homepage":"http://silverstripe.org/","size":69492,"stargazers_count":490,"watchers_count":490,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":562,"mirror_url":null,"open_issues_count":673,"forks":562,"open_issues":673,"watchers":490,"default_branch":"3"}},"_links":{"self":{"href":"https://api.github.com/repos/silverstripe/silverstripe-framework/pulls/5091"},"html":{"href":"https://github.com/silverstripe/silverstripe-framework/pull/5091"},"issue":{"href":"https://api.github.com/repos/silverstripe/silverstripe-framework/issues/5091"},"comments":{"href":"https://api.github.com/repos/silverstripe/silverstripe-framework/issues/5091/comments"},"review_comments":{"href":"https://api.github.com/repos/silverstripe/silverstripe-framework/pulls/5091/comments"},"review_comment":{"href":"https://api.github.com/repos/silverstripe/silverstripe-framework/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/silverstripe/silverstripe-framework/pulls/5091/commits"},"statuses":{"href":"https://api.github.com/repos/silverstripe/silverstripe-framework/statuses/f2e4fa3682832bff2deb6fdfd2a26b262100718b"}}}}