{"action":"created","comment":{"url":"https://api.github.com/repos/UseMuffin/Footprint/pulls/comments/64150992","id":64150992,"diff_hunk":"@@ -80,7 +81,18 @@ public function beforeFind(Event $event, Query $query, ArrayObject $options)\n \n         foreach (array_keys($config) as $field) {\n             $path = $this->config('propertiesMap.' . $field);\n-            if ($value = Hash::get((array)$options, $path)) {\n+\n+            $check = false;\n+            $query->traverseExpressions(function ($expression) use (&$check, $field, $query) {\n+                if ($expression instanceof IdentifierExpression) {\n+                    !$check && $check = $expression->getIdentifier() === $field;\n+                    return;\n+                }\n+                $alias = $this->_table->aliasField($field);\n+                !$check && $check = preg_match('/^' . $alias . '/', $expression->sql($query->valueBinder()));","path":"src/Model/Behavior/FootprintBehavior.php","position":21,"original_position":21,"commit_id":"7bbf089b2f6db31ebf9accac021244668af2e825","original_commit_id":"7bbf089b2f6db31ebf9accac021244668af2e825","user":{"login":"ADmad","id":142658,"avatar_url":"https://avatars.githubusercontent.com/u/142658?v=3","gravatar_id":"","url":"https://api.github.com/users/ADmad","html_url":"https://github.com/ADmad","followers_url":"https://api.github.com/users/ADmad/followers","following_url":"https://api.github.com/users/ADmad/following{/other_user}","gists_url":"https://api.github.com/users/ADmad/gists{/gist_id}","starred_url":"https://api.github.com/users/ADmad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ADmad/subscriptions","organizations_url":"https://api.github.com/users/ADmad/orgs","repos_url":"https://api.github.com/users/ADmad/repos","events_url":"https://api.github.com/users/ADmad/events{/privacy}","received_events_url":"https://api.github.com/users/ADmad/received_events","type":"User","site_admin":false},"body":"Nope, that only covered conditions added by the behavior not user added conditions. We'll see about that later, merging.","created_at":"2016-05-22T14:49:39Z","updated_at":"2016-05-22T14:49:39Z","html_url":"https://github.com/UseMuffin/Footprint/pull/14#discussion_r64150992","pull_request_url":"https://api.github.com/repos/UseMuffin/Footprint/pulls/14","_links":{"self":{"href":"https://api.github.com/repos/UseMuffin/Footprint/pulls/comments/64150992"},"html":{"href":"https://github.com/UseMuffin/Footprint/pull/14#discussion_r64150992"},"pull_request":{"href":"https://api.github.com/repos/UseMuffin/Footprint/pulls/14"}}},"pull_request":{"url":"https://api.github.com/repos/UseMuffin/Footprint/pulls/14","id":45458824,"html_url":"https://github.com/UseMuffin/Footprint/pull/14","diff_url":"https://github.com/UseMuffin/Footprint/pull/14.diff","patch_url":"https://github.com/UseMuffin/Footprint/pull/14.patch","issue_url":"https://api.github.com/repos/UseMuffin/Footprint/issues/14","number":14,"state":"open","locked":false,"title":"Fix cases when identifier part of expression already","user":{"login":"jadb","id":33527,"avatar_url":"https://avatars.githubusercontent.com/u/33527?v=3","gravatar_id":"","url":"https://api.github.com/users/jadb","html_url":"https://github.com/jadb","followers_url":"https://api.github.com/users/jadb/followers","following_url":"https://api.github.com/users/jadb/following{/other_user}","gists_url":"https://api.github.com/users/jadb/gists{/gist_id}","starred_url":"https://api.github.com/users/jadb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jadb/subscriptions","organizations_url":"https://api.github.com/users/jadb/orgs","repos_url":"https://api.github.com/users/jadb/repos","events_url":"https://api.github.com/users/jadb/events{/privacy}","received_events_url":"https://api.github.com/users/jadb/received_events","type":"User","site_admin":false},"body":"Sometimes, the field being used by the behavior (on `Model.beforeFind`) is already part of the find query which would cause an error or at the very least, override the original intention.\r\n\r\nStill missing tests to catch it in the future and probably split that into its own method - but first I'd like confirmation that this looks somewhat close to the final solution.\r\n\r\n(ps: it works)","created_at":"2015-09-18T22:19:24Z","updated_at":"2016-05-22T14:49:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8c80729fd9166a231a58b96b11296d85593fc518","assignee":{"login":"jadb","id":33527,"avatar_url":"https://avatars.githubusercontent.com/u/33527?v=3","gravatar_id":"","url":"https://api.github.com/users/jadb","html_url":"https://github.com/jadb","followers_url":"https://api.github.com/users/jadb/followers","following_url":"https://api.github.com/users/jadb/following{/other_user}","gists_url":"https://api.github.com/users/jadb/gists{/gist_id}","starred_url":"https://api.github.com/users/jadb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jadb/subscriptions","organizations_url":"https://api.github.com/users/jadb/orgs","repos_url":"https://api.github.com/users/jadb/repos","events_url":"https://api.github.com/users/jadb/events{/privacy}","received_events_url":"https://api.github.com/users/jadb/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/UseMuffin/Footprint/milestones/1","html_url":"https://github.com/UseMuffin/Footprint/milestones/0.1","labels_url":"https://api.github.com/repos/UseMuffin/Footprint/milestones/1/labels","id":1609671,"number":1,"title":"0.1","description":"","creator":{"login":"jadb","id":33527,"avatar_url":"https://avatars.githubusercontent.com/u/33527?v=3","gravatar_id":"","url":"https://api.github.com/users/jadb","html_url":"https://github.com/jadb","followers_url":"https://api.github.com/users/jadb/followers","following_url":"https://api.github.com/users/jadb/following{/other_user}","gists_url":"https://api.github.com/users/jadb/gists{/gist_id}","starred_url":"https://api.github.com/users/jadb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jadb/subscriptions","organizations_url":"https://api.github.com/users/jadb/orgs","repos_url":"https://api.github.com/users/jadb/repos","events_url":"https://api.github.com/users/jadb/events{/privacy}","received_events_url":"https://api.github.com/users/jadb/received_events","type":"User","site_admin":false},"open_issues":1,"closed_issues":3,"state":"open","created_at":"2016-02-27T19:54:34Z","updated_at":"2016-05-13T17:42:53Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/UseMuffin/Footprint/pulls/14/commits","review_comments_url":"https://api.github.com/repos/UseMuffin/Footprint/pulls/14/comments","review_comment_url":"https://api.github.com/repos/UseMuffin/Footprint/pulls/comments{/number}","comments_url":"https://api.github.com/repos/UseMuffin/Footprint/issues/14/comments","statuses_url":"https://api.github.com/repos/UseMuffin/Footprint/statuses/7bbf089b2f6db31ebf9accac021244668af2e825","head":{"label":"UseMuffin:skip-if-field-in-expression","ref":"skip-if-field-in-expression","sha":"7bbf089b2f6db31ebf9accac021244668af2e825","user":{"login":"UseMuffin","id":11860852,"avatar_url":"https://avatars.githubusercontent.com/u/11860852?v=3","gravatar_id":"","url":"https://api.github.com/users/UseMuffin","html_url":"https://github.com/UseMuffin","followers_url":"https://api.github.com/users/UseMuffin/followers","following_url":"https://api.github.com/users/UseMuffin/following{/other_user}","gists_url":"https://api.github.com/users/UseMuffin/gists{/gist_id}","starred_url":"https://api.github.com/users/UseMuffin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UseMuffin/subscriptions","organizations_url":"https://api.github.com/users/UseMuffin/orgs","repos_url":"https://api.github.com/users/UseMuffin/repos","events_url":"https://api.github.com/users/UseMuffin/events{/privacy}","received_events_url":"https://api.github.com/users/UseMuffin/received_events","type":"Organization","site_admin":false},"repo":{"id":34571038,"name":"Footprint","full_name":"UseMuffin/Footprint","owner":{"login":"UseMuffin","id":11860852,"avatar_url":"https://avatars.githubusercontent.com/u/11860852?v=3","gravatar_id":"","url":"https://api.github.com/users/UseMuffin","html_url":"https://github.com/UseMuffin","followers_url":"https://api.github.com/users/UseMuffin/followers","following_url":"https://api.github.com/users/UseMuffin/following{/other_user}","gists_url":"https://api.github.com/users/UseMuffin/gists{/gist_id}","starred_url":"https://api.github.com/users/UseMuffin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UseMuffin/subscriptions","organizations_url":"https://api.github.com/users/UseMuffin/orgs","repos_url":"https://api.github.com/users/UseMuffin/repos","events_url":"https://api.github.com/users/UseMuffin/events{/privacy}","received_events_url":"https://api.github.com/users/UseMuffin/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/UseMuffin/Footprint","description":"CakePHP plugin to allow passing currently logged in user to model layer.","fork":false,"url":"https://api.github.com/repos/UseMuffin/Footprint","forks_url":"https://api.github.com/repos/UseMuffin/Footprint/forks","keys_url":"https://api.github.com/repos/UseMuffin/Footprint/keys{/key_id}","collaborators_url":"https://api.github.com/repos/UseMuffin/Footprint/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/UseMuffin/Footprint/teams","hooks_url":"https://api.github.com/repos/UseMuffin/Footprint/hooks","issue_events_url":"https://api.github.com/repos/UseMuffin/Footprint/issues/events{/number}","events_url":"https://api.github.com/repos/UseMuffin/Footprint/events","assignees_url":"https://api.github.com/repos/UseMuffin/Footprint/assignees{/user}","branches_url":"https://api.github.com/repos/UseMuffin/Footprint/branches{/branch}","tags_url":"https://api.github.com/repos/UseMuffin/Footprint/tags","blobs_url":"https://api.github.com/repos/UseMuffin/Footprint/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/UseMuffin/Footprint/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/UseMuffin/Footprint/git/refs{/sha}","trees_url":"https://api.github.com/repos/UseMuffin/Footprint/git/trees{/sha}","statuses_url":"https://api.github.com/repos/UseMuffin/Footprint/statuses/{sha}","languages_url":"https://api.github.com/repos/UseMuffin/Footprint/languages","stargazers_url":"https://api.github.com/repos/UseMuffin/Footprint/stargazers","contributors_url":"https://api.github.com/repos/UseMuffin/Footprint/contributors","subscribers_url":"https://api.github.com/repos/UseMuffin/Footprint/subscribers","subscription_url":"https://api.github.com/repos/UseMuffin/Footprint/subscription","commits_url":"https://api.github.com/repos/UseMuffin/Footprint/commits{/sha}","git_commits_url":"https://api.github.com/repos/UseMuffin/Footprint/git/commits{/sha}","comments_url":"https://api.github.com/repos/UseMuffin/Footprint/comments{/number}","issue_comment_url":"https://api.github.com/repos/UseMuffin/Footprint/issues/comments{/number}","contents_url":"https://api.github.com/repos/UseMuffin/Footprint/contents/{+path}","compare_url":"https://api.github.com/repos/UseMuffin/Footprint/compare/{base}...{head}","merges_url":"https://api.github.com/repos/UseMuffin/Footprint/merges","archive_url":"https://api.github.com/repos/UseMuffin/Footprint/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/UseMuffin/Footprint/downloads","issues_url":"https://api.github.com/repos/UseMuffin/Footprint/issues{/number}","pulls_url":"https://api.github.com/repos/UseMuffin/Footprint/pulls{/number}","milestones_url":"https://api.github.com/repos/UseMuffin/Footprint/milestones{/number}","notifications_url":"https://api.github.com/repos/UseMuffin/Footprint/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/UseMuffin/Footprint/labels{/name}","releases_url":"https://api.github.com/repos/UseMuffin/Footprint/releases{/id}","deployments_url":"https://api.github.com/repos/UseMuffin/Footprint/deployments","created_at":"2015-04-25T14:14:03Z","updated_at":"2016-04-25T12:27:08Z","pushed_at":"2016-05-13T19:06:44Z","git_url":"git://github.com/UseMuffin/Footprint.git","ssh_url":"git@github.com:UseMuffin/Footprint.git","clone_url":"https://github.com/UseMuffin/Footprint.git","svn_url":"https://github.com/UseMuffin/Footprint","homepage":"","size":57,"stargazers_count":37,"watchers_count":37,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":2,"forks":6,"open_issues":2,"watchers":37,"default_branch":"master"}},"base":{"label":"UseMuffin:master","ref":"master","sha":"7f3299e41f2e0be209b9286e886b531993feb5b4","user":{"login":"UseMuffin","id":11860852,"avatar_url":"https://avatars.githubusercontent.com/u/11860852?v=3","gravatar_id":"","url":"https://api.github.com/users/UseMuffin","html_url":"https://github.com/UseMuffin","followers_url":"https://api.github.com/users/UseMuffin/followers","following_url":"https://api.github.com/users/UseMuffin/following{/other_user}","gists_url":"https://api.github.com/users/UseMuffin/gists{/gist_id}","starred_url":"https://api.github.com/users/UseMuffin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UseMuffin/subscriptions","organizations_url":"https://api.github.com/users/UseMuffin/orgs","repos_url":"https://api.github.com/users/UseMuffin/repos","events_url":"https://api.github.com/users/UseMuffin/events{/privacy}","received_events_url":"https://api.github.com/users/UseMuffin/received_events","type":"Organization","site_admin":false},"repo":{"id":34571038,"name":"Footprint","full_name":"UseMuffin/Footprint","owner":{"login":"UseMuffin","id":11860852,"avatar_url":"https://avatars.githubusercontent.com/u/11860852?v=3","gravatar_id":"","url":"https://api.github.com/users/UseMuffin","html_url":"https://github.com/UseMuffin","followers_url":"https://api.github.com/users/UseMuffin/followers","following_url":"https://api.github.com/users/UseMuffin/following{/other_user}","gists_url":"https://api.github.com/users/UseMuffin/gists{/gist_id}","starred_url":"https://api.github.com/users/UseMuffin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UseMuffin/subscriptions","organizations_url":"https://api.github.com/users/UseMuffin/orgs","repos_url":"https://api.github.com/users/UseMuffin/repos","events_url":"https://api.github.com/users/UseMuffin/events{/privacy}","received_events_url":"https://api.github.com/users/UseMuffin/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/UseMuffin/Footprint","description":"CakePHP plugin to allow passing currently logged in user to model layer.","fork":false,"url":"https://api.github.com/repos/UseMuffin/Footprint","forks_url":"https://api.github.com/repos/UseMuffin/Footprint/forks","keys_url":"https://api.github.com/repos/UseMuffin/Footprint/keys{/key_id}","collaborators_url":"https://api.github.com/repos/UseMuffin/Footprint/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/UseMuffin/Footprint/teams","hooks_url":"https://api.github.com/repos/UseMuffin/Footprint/hooks","issue_events_url":"https://api.github.com/repos/UseMuffin/Footprint/issues/events{/number}","events_url":"https://api.github.com/repos/UseMuffin/Footprint/events","assignees_url":"https://api.github.com/repos/UseMuffin/Footprint/assignees{/user}","branches_url":"https://api.github.com/repos/UseMuffin/Footprint/branches{/branch}","tags_url":"https://api.github.com/repos/UseMuffin/Footprint/tags","blobs_url":"https://api.github.com/repos/UseMuffin/Footprint/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/UseMuffin/Footprint/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/UseMuffin/Footprint/git/refs{/sha}","trees_url":"https://api.github.com/repos/UseMuffin/Footprint/git/trees{/sha}","statuses_url":"https://api.github.com/repos/UseMuffin/Footprint/statuses/{sha}","languages_url":"https://api.github.com/repos/UseMuffin/Footprint/languages","stargazers_url":"https://api.github.com/repos/UseMuffin/Footprint/stargazers","contributors_url":"https://api.github.com/repos/UseMuffin/Footprint/contributors","subscribers_url":"https://api.github.com/repos/UseMuffin/Footprint/subscribers","subscription_url":"https://api.github.com/repos/UseMuffin/Footprint/subscription","commits_url":"https://api.github.com/repos/UseMuffin/Footprint/commits{/sha}","git_commits_url":"https://api.github.com/repos/UseMuffin/Footprint/git/commits{/sha}","comments_url":"https://api.github.com/repos/UseMuffin/Footprint/comments{/number}","issue_comment_url":"https://api.github.com/repos/UseMuffin/Footprint/issues/comments{/number}","contents_url":"https://api.github.com/repos/UseMuffin/Footprint/contents/{+path}","compare_url":"https://api.github.com/repos/UseMuffin/Footprint/compare/{base}...{head}","merges_url":"https://api.github.com/repos/UseMuffin/Footprint/merges","archive_url":"https://api.github.com/repos/UseMuffin/Footprint/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/UseMuffin/Footprint/downloads","issues_url":"https://api.github.com/repos/UseMuffin/Footprint/issues{/number}","pulls_url":"https://api.github.com/repos/UseMuffin/Footprint/pulls{/number}","milestones_url":"https://api.github.com/repos/UseMuffin/Footprint/milestones{/number}","notifications_url":"https://api.github.com/repos/UseMuffin/Footprint/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/UseMuffin/Footprint/labels{/name}","releases_url":"https://api.github.com/repos/UseMuffin/Footprint/releases{/id}","deployments_url":"https://api.github.com/repos/UseMuffin/Footprint/deployments","created_at":"2015-04-25T14:14:03Z","updated_at":"2016-04-25T12:27:08Z","pushed_at":"2016-05-13T19:06:44Z","git_url":"git://github.com/UseMuffin/Footprint.git","ssh_url":"git@github.com:UseMuffin/Footprint.git","clone_url":"https://github.com/UseMuffin/Footprint.git","svn_url":"https://github.com/UseMuffin/Footprint","homepage":"","size":57,"stargazers_count":37,"watchers_count":37,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":2,"forks":6,"open_issues":2,"watchers":37,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/UseMuffin/Footprint/pulls/14"},"html":{"href":"https://github.com/UseMuffin/Footprint/pull/14"},"issue":{"href":"https://api.github.com/repos/UseMuffin/Footprint/issues/14"},"comments":{"href":"https://api.github.com/repos/UseMuffin/Footprint/issues/14/comments"},"review_comments":{"href":"https://api.github.com/repos/UseMuffin/Footprint/pulls/14/comments"},"review_comment":{"href":"https://api.github.com/repos/UseMuffin/Footprint/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/UseMuffin/Footprint/pulls/14/commits"},"statuses":{"href":"https://api.github.com/repos/UseMuffin/Footprint/statuses/7bbf089b2f6db31ebf9accac021244668af2e825"}}}}
{"actor":{"display_login":"ADmad"}}