{"action":"created","issue":{"url":"https://api.github.com/repos/dereuromark/cakephp-tools/issues/153","labels_url":"https://api.github.com/repos/dereuromark/cakephp-tools/issues/153/labels{/name}","comments_url":"https://api.github.com/repos/dereuromark/cakephp-tools/issues/153/comments","events_url":"https://api.github.com/repos/dereuromark/cakephp-tools/issues/153/events","html_url":"https://github.com/dereuromark/cakephp-tools/issues/153","id":101842334,"number":153,"title":"Jsonable: Error when find list","user":{"login":"ayman-alkom","id":2862528,"avatar_url":"https://avatars.githubusercontent.com/u/2862528?v=3","gravatar_id":"","url":"https://api.github.com/users/ayman-alkom","html_url":"https://github.com/ayman-alkom","followers_url":"https://api.github.com/users/ayman-alkom/followers","following_url":"https://api.github.com/users/ayman-alkom/following{/other_user}","gists_url":"https://api.github.com/users/ayman-alkom/gists{/gist_id}","starred_url":"https://api.github.com/users/ayman-alkom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ayman-alkom/subscriptions","organizations_url":"https://api.github.com/users/ayman-alkom/orgs","repos_url":"https://api.github.com/users/ayman-alkom/repos","events_url":"https://api.github.com/users/ayman-alkom/events{/privacy}","received_events_url":"https://api.github.com/users/ayman-alkom/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-08-19T09:08:05Z","updated_at":"2015-08-19T09:31:56Z","closed_at":null,"body":"Hi @dereuromark , I had an error when I tried to run `list` finder on my model witch has a Jsonable Behavior, in Cakephp 3.x.\r\nThe error is in the line 100, I tried to correct it but I couldn't, it seems we have to check the finder name before format the the results.\r\n\r\nNote: the `$row` in line 102 is just a string in my list finder case and not Entity, I hoped to make a PR \r\nthanks again for this awesome plugin. "},"comment":{"url":"https://api.github.com/repos/dereuromark/cakephp-tools/issues/comments/132508767","html_url":"https://github.com/dereuromark/cakephp-tools/issues/153#issuecomment-132508767","issue_url":"https://api.github.com/repos/dereuromark/cakephp-tools/issues/153","id":132508767,"user":{"login":"ayman-alkom","id":2862528,"avatar_url":"https://avatars.githubusercontent.com/u/2862528?v=3","gravatar_id":"","url":"https://api.github.com/users/ayman-alkom","html_url":"https://github.com/ayman-alkom","followers_url":"https://api.github.com/users/ayman-alkom/followers","following_url":"https://api.github.com/users/ayman-alkom/following{/other_user}","gists_url":"https://api.github.com/users/ayman-alkom/gists{/gist_id}","starred_url":"https://api.github.com/users/ayman-alkom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ayman-alkom/subscriptions","organizations_url":"https://api.github.com/users/ayman-alkom/orgs","repos_url":"https://api.github.com/users/ayman-alkom/repos","events_url":"https://api.github.com/users/ayman-alkom/events{/privacy}","received_events_url":"https://api.github.com/users/ayman-alkom/received_events","type":"User","site_admin":false},"created_at":"2015-08-19T09:31:56Z","updated_at":"2015-08-19T09:31:56Z","body":"I tried with this for example:\r\n```\r\n    public function beforeFind(Event $event, Query $query)\r\n        {\r\n            $query->formatResults(function (ResultSetInterface $results) {\r\n                return $results->map(function ($row) {\r\n                    if(is_object($row)){\r\n                        $this->decodeItems($row);\r\n                    }\r\n\r\n                return $row;\r\n            });\r\n        });\r\n    }\r\n```\r\nbut some warning still appear:\r\n\r\n```\r\nWarning (4096): Argument 1 passed to Tools\\Model\\Behavior\\JsonableBehavior::Tools\\Model\\Behavior\\{closure}() must implement interface Cake\\Datasource\\ResultSetInterface, instance of Cake\\Collection\\Collection given, called in C:\\wamp\\www\\apps\\rest_app\\vendor\\cakephp\\cakephp\\src\\Datasource\\QueryTrait.php on line 436 and defined [ROOT\\vendor\\dereuromark\\cakephp-tools\\src\\Model\\Behavior\\JsonableBehavior.php, line 104]\r\n\r\n```"}}