{"action":"created","comment":{"url":"https://api.github.com/repos/QoboLtd/cakephp-cms/pulls/comments/66210721","id":66210721,"diff_hunk":"@@ -17,14 +17,29 @@ class ArticlesController extends AppController\n      */\n     public function index()\n     {\n-        $query = $this->Articles\n+        $search = $this->request->query('s');\n+        $articles = $this->Articles\n             ->find('withLatestImage')\n             ->order(['modified' => 'DESC']);\n-        $articles = $this->paginate($query);\n-        if ($articles->isEmpty()) {\n-            $this->Flash->set(__('No articles were found. Please add one.'));\n-            return $this->redirect(['action' => 'add']);\n+        if (is_null($search)) {\n+            if ($articles->isEmpty()) {\n+                $this->Flash->set(__('No articles were found. Please add one.'));\n+                return $this->redirect(['action' => 'add']);\n+            }\n+        } else {\n+            $articles = $articles->find(\n+                'search',\n+                [\n+                    'fieldNames' => ['title', 'slug'],","path":"src/Controller/ArticlesController.php","position":22,"original_position":22,"commit_id":"da3e3d3ee779ad5cc80ec245629b166064e0e74b","original_commit_id":"da3e3d3ee779ad5cc80ec245629b166064e0e74b","user":{"login":"flangofas","id":1227351,"avatar_url":"https://avatars.githubusercontent.com/u/1227351?v=3","gravatar_id":"","url":"https://api.github.com/users/flangofas","html_url":"https://github.com/flangofas","followers_url":"https://api.github.com/users/flangofas/followers","following_url":"https://api.github.com/users/flangofas/following{/other_user}","gists_url":"https://api.github.com/users/flangofas/gists{/gist_id}","starred_url":"https://api.github.com/users/flangofas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flangofas/subscriptions","organizations_url":"https://api.github.com/users/flangofas/orgs","repos_url":"https://api.github.com/users/flangofas/repos","events_url":"https://api.github.com/users/flangofas/events{/privacy}","received_events_url":"https://api.github.com/users/flangofas/received_events","type":"User","site_admin":false},"body":"@mamchenkov they are not show on the index page. is it OK?\r\n","created_at":"2016-06-08T08:19:29Z","updated_at":"2016-06-08T08:19:29Z","html_url":"https://github.com/QoboLtd/cakephp-cms/pull/53#discussion_r66210721","pull_request_url":"https://api.github.com/repos/QoboLtd/cakephp-cms/pulls/53","_links":{"self":{"href":"https://api.github.com/repos/QoboLtd/cakephp-cms/pulls/comments/66210721"},"html":{"href":"https://github.com/QoboLtd/cakephp-cms/pull/53#discussion_r66210721"},"pull_request":{"href":"https://api.github.com/repos/QoboLtd/cakephp-cms/pulls/53"}}},"pull_request":{"url":"https://api.github.com/repos/QoboLtd/cakephp-cms/pulls/53","id":73003301,"html_url":"https://github.com/QoboLtd/cakephp-cms/pull/53","diff_url":"https://github.com/QoboLtd/cakephp-cms/pull/53.diff","patch_url":"https://github.com/QoboLtd/cakephp-cms/pull/53.patch","issue_url":"https://api.github.com/repos/QoboLtd/cakephp-cms/issues/53","number":53,"state":"open","locked":false,"title":"Search articles functionallity (task #2160)","user":{"login":"flangofas","id":1227351,"avatar_url":"https://avatars.githubusercontent.com/u/1227351?v=3","gravatar_id":"","url":"https://api.github.com/users/flangofas","html_url":"https://github.com/flangofas","followers_url":"https://api.github.com/users/flangofas/followers","following_url":"https://api.github.com/users/flangofas/following{/other_user}","gists_url":"https://api.github.com/users/flangofas/gists{/gist_id}","starred_url":"https://api.github.com/users/flangofas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flangofas/subscriptions","organizations_url":"https://api.github.com/users/flangofas/orgs","repos_url":"https://api.github.com/users/flangofas/repos","events_url":"https://api.github.com/users/flangofas/events{/privacy}","received_events_url":"https://api.github.com/users/flangofas/received_events","type":"User","site_admin":false},"body":"![ss-cms-articles-search](https://cloud.githubusercontent.com/assets/1227351/15887398/bbba777e-2d6a-11e6-938f-a4415fcc8217.png)\r\n","created_at":"2016-06-08T08:12:49Z","updated_at":"2016-06-08T08:19:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"aa286a4e891985d1566120fdfd677e9fc9113c77","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/QoboLtd/cakephp-cms/pulls/53/commits","review_comments_url":"https://api.github.com/repos/QoboLtd/cakephp-cms/pulls/53/comments","review_comment_url":"https://api.github.com/repos/QoboLtd/cakephp-cms/pulls/comments{/number}","comments_url":"https://api.github.com/repos/QoboLtd/cakephp-cms/issues/53/comments","statuses_url":"https://api.github.com/repos/QoboLtd/cakephp-cms/statuses/da3e3d3ee779ad5cc80ec245629b166064e0e74b","head":{"label":"QoboLtd:2160-search-function","ref":"2160-search-function","sha":"da3e3d3ee779ad5cc80ec245629b166064e0e74b","user":{"login":"QoboLtd","id":9074850,"avatar_url":"https://avatars.githubusercontent.com/u/9074850?v=3","gravatar_id":"","url":"https://api.github.com/users/QoboLtd","html_url":"https://github.com/QoboLtd","followers_url":"https://api.github.com/users/QoboLtd/followers","following_url":"https://api.github.com/users/QoboLtd/following{/other_user}","gists_url":"https://api.github.com/users/QoboLtd/gists{/gist_id}","starred_url":"https://api.github.com/users/QoboLtd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/QoboLtd/subscriptions","organizations_url":"https://api.github.com/users/QoboLtd/orgs","repos_url":"https://api.github.com/users/QoboLtd/repos","events_url":"https://api.github.com/users/QoboLtd/events{/privacy}","received_events_url":"https://api.github.com/users/QoboLtd/received_events","type":"Organization","site_admin":false},"repo":{"id":52283198,"name":"cakephp-cms","full_name":"QoboLtd/cakephp-cms","owner":{"login":"QoboLtd","id":9074850,"avatar_url":"https://avatars.githubusercontent.com/u/9074850?v=3","gravatar_id":"","url":"https://api.github.com/users/QoboLtd","html_url":"https://github.com/QoboLtd","followers_url":"https://api.github.com/users/QoboLtd/followers","following_url":"https://api.github.com/users/QoboLtd/following{/other_user}","gists_url":"https://api.github.com/users/QoboLtd/gists{/gist_id}","starred_url":"https://api.github.com/users/QoboLtd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/QoboLtd/subscriptions","organizations_url":"https://api.github.com/users/QoboLtd/orgs","repos_url":"https://api.github.com/users/QoboLtd/repos","events_url":"https://api.github.com/users/QoboLtd/events{/privacy}","received_events_url":"https://api.github.com/users/QoboLtd/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/QoboLtd/cakephp-cms","description":"CakePHP plugin for the CMS functionality","fork":false,"url":"https://api.github.com/repos/QoboLtd/cakephp-cms","forks_url":"https://api.github.com/repos/QoboLtd/cakephp-cms/forks","keys_url":"https://api.github.com/repos/QoboLtd/cakephp-cms/keys{/key_id}","collaborators_url":"https://api.github.com/repos/QoboLtd/cakephp-cms/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/QoboLtd/cakephp-cms/teams","hooks_url":"https://api.github.com/repos/QoboLtd/cakephp-cms/hooks","issue_events_url":"https://api.github.com/repos/QoboLtd/cakephp-cms/issues/events{/number}","events_url":"https://api.github.com/repos/QoboLtd/cakephp-cms/events","assignees_url":"https://api.github.com/repos/QoboLtd/cakephp-cms/assignees{/user}","branches_url":"https://api.github.com/repos/QoboLtd/cakephp-cms/branches{/branch}","tags_url":"https://api.github.com/repos/QoboLtd/cakephp-cms/tags","blobs_url":"https://api.github.com/repos/QoboLtd/cakephp-cms/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/QoboLtd/cakephp-cms/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/QoboLtd/cakephp-cms/git/refs{/sha}","trees_url":"https://api.github.com/repos/QoboLtd/cakephp-cms/git/trees{/sha}","statuses_url":"https://api.github.com/repos/QoboLtd/cakephp-cms/statuses/{sha}","languages_url":"https://api.github.com/repos/QoboLtd/cakephp-cms/languages","stargazers_url":"https://api.github.com/repos/QoboLtd/cakephp-cms/stargazers","contributors_url":"https://api.github.com/repos/QoboLtd/cakephp-cms/contributors","subscribers_url":"https://api.github.com/repos/QoboLtd/cakephp-cms/subscribers","subscription_url":"https://api.github.com/repos/QoboLtd/cakephp-cms/subscription","commits_url":"https://api.github.com/repos/QoboLtd/cakephp-cms/commits{/sha}","git_commits_url":"https://api.github.com/repos/QoboLtd/cakephp-cms/git/commits{/sha}","comments_url":"https://api.github.com/repos/QoboLtd/cakephp-cms/comments{/number}","issue_comment_url":"https://api.github.com/repos/QoboLtd/cakephp-cms/issues/comments{/number}","contents_url":"https://api.github.com/repos/QoboLtd/cakephp-cms/contents/{+path}","compare_url":"https://api.github.com/repos/QoboLtd/cakephp-cms/compare/{base}...{head}","merges_url":"https://api.github.com/repos/QoboLtd/cakephp-cms/merges","archive_url":"https://api.github.com/repos/QoboLtd/cakephp-cms/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/QoboLtd/cakephp-cms/downloads","issues_url":"https://api.github.com/repos/QoboLtd/cakephp-cms/issues{/number}","pulls_url":"https://api.github.com/repos/QoboLtd/cakephp-cms/pulls{/number}","milestones_url":"https://api.github.com/repos/QoboLtd/cakephp-cms/milestones{/number}","notifications_url":"https://api.github.com/repos/QoboLtd/cakephp-cms/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/QoboLtd/cakephp-cms/labels{/name}","releases_url":"https://api.github.com/repos/QoboLtd/cakephp-cms/releases{/id}","deployments_url":"https://api.github.com/repos/QoboLtd/cakephp-cms/deployments","created_at":"2016-02-22T15:29:13Z","updated_at":"2016-02-22T15:37:53Z","pushed_at":"2016-06-08T08:12:52Z","git_url":"git://github.com/QoboLtd/cakephp-cms.git","ssh_url":"git@github.com:QoboLtd/cakephp-cms.git","clone_url":"https://github.com/QoboLtd/cakephp-cms.git","svn_url":"https://github.com/QoboLtd/cakephp-cms","homepage":null,"size":170,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"QoboLtd:master","ref":"master","sha":"bb84a6494676e4aea36e2500c25158b224e77c03","user":{"login":"QoboLtd","id":9074850,"avatar_url":"https://avatars.githubusercontent.com/u/9074850?v=3","gravatar_id":"","url":"https://api.github.com/users/QoboLtd","html_url":"https://github.com/QoboLtd","followers_url":"https://api.github.com/users/QoboLtd/followers","following_url":"https://api.github.com/users/QoboLtd/following{/other_user}","gists_url":"https://api.github.com/users/QoboLtd/gists{/gist_id}","starred_url":"https://api.github.com/users/QoboLtd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/QoboLtd/subscriptions","organizations_url":"https://api.github.com/users/QoboLtd/orgs","repos_url":"https://api.github.com/users/QoboLtd/repos","events_url":"https://api.github.com/users/QoboLtd/events{/privacy}","received_events_url":"https://api.github.com/users/QoboLtd/received_events","type":"Organization","site_admin":false},"repo":{"id":52283198,"name":"cakephp-cms","full_name":"QoboLtd/cakephp-cms","owner":{"login":"QoboLtd","id":9074850,"avatar_url":"https://avatars.githubusercontent.com/u/9074850?v=3","gravatar_id":"","url":"https://api.github.com/users/QoboLtd","html_url":"https://github.com/QoboLtd","followers_url":"https://api.github.com/users/QoboLtd/followers","following_url":"https://api.github.com/users/QoboLtd/following{/other_user}","gists_url":"https://api.github.com/users/QoboLtd/gists{/gist_id}","starred_url":"https://api.github.com/users/QoboLtd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/QoboLtd/subscriptions","organizations_url":"https://api.github.com/users/QoboLtd/orgs","repos_url":"https://api.github.com/users/QoboLtd/repos","events_url":"https://api.github.com/users/QoboLtd/events{/privacy}","received_events_url":"https://api.github.com/users/QoboLtd/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/QoboLtd/cakephp-cms","description":"CakePHP plugin for the CMS functionality","fork":false,"url":"https://api.github.com/repos/QoboLtd/cakephp-cms","forks_url":"https://api.github.com/repos/QoboLtd/cakephp-cms/forks","keys_url":"https://api.github.com/repos/QoboLtd/cakephp-cms/keys{/key_id}","collaborators_url":"https://api.github.com/repos/QoboLtd/cakephp-cms/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/QoboLtd/cakephp-cms/teams","hooks_url":"https://api.github.com/repos/QoboLtd/cakephp-cms/hooks","issue_events_url":"https://api.github.com/repos/QoboLtd/cakephp-cms/issues/events{/number}","events_url":"https://api.github.com/repos/QoboLtd/cakephp-cms/events","assignees_url":"https://api.github.com/repos/QoboLtd/cakephp-cms/assignees{/user}","branches_url":"https://api.github.com/repos/QoboLtd/cakephp-cms/branches{/branch}","tags_url":"https://api.github.com/repos/QoboLtd/cakephp-cms/tags","blobs_url":"https://api.github.com/repos/QoboLtd/cakephp-cms/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/QoboLtd/cakephp-cms/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/QoboLtd/cakephp-cms/git/refs{/sha}","trees_url":"https://api.github.com/repos/QoboLtd/cakephp-cms/git/trees{/sha}","statuses_url":"https://api.github.com/repos/QoboLtd/cakephp-cms/statuses/{sha}","languages_url":"https://api.github.com/repos/QoboLtd/cakephp-cms/languages","stargazers_url":"https://api.github.com/repos/QoboLtd/cakephp-cms/stargazers","contributors_url":"https://api.github.com/repos/QoboLtd/cakephp-cms/contributors","subscribers_url":"https://api.github.com/repos/QoboLtd/cakephp-cms/subscribers","subscription_url":"https://api.github.com/repos/QoboLtd/cakephp-cms/subscription","commits_url":"https://api.github.com/repos/QoboLtd/cakephp-cms/commits{/sha}","git_commits_url":"https://api.github.com/repos/QoboLtd/cakephp-cms/git/commits{/sha}","comments_url":"https://api.github.com/repos/QoboLtd/cakephp-cms/comments{/number}","issue_comment_url":"https://api.github.com/repos/QoboLtd/cakephp-cms/issues/comments{/number}","contents_url":"https://api.github.com/repos/QoboLtd/cakephp-cms/contents/{+path}","compare_url":"https://api.github.com/repos/QoboLtd/cakephp-cms/compare/{base}...{head}","merges_url":"https://api.github.com/repos/QoboLtd/cakephp-cms/merges","archive_url":"https://api.github.com/repos/QoboLtd/cakephp-cms/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/QoboLtd/cakephp-cms/downloads","issues_url":"https://api.github.com/repos/QoboLtd/cakephp-cms/issues{/number}","pulls_url":"https://api.github.com/repos/QoboLtd/cakephp-cms/pulls{/number}","milestones_url":"https://api.github.com/repos/QoboLtd/cakephp-cms/milestones{/number}","notifications_url":"https://api.github.com/repos/QoboLtd/cakephp-cms/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/QoboLtd/cakephp-cms/labels{/name}","releases_url":"https://api.github.com/repos/QoboLtd/cakephp-cms/releases{/id}","deployments_url":"https://api.github.com/repos/QoboLtd/cakephp-cms/deployments","created_at":"2016-02-22T15:29:13Z","updated_at":"2016-02-22T15:37:53Z","pushed_at":"2016-06-08T08:12:52Z","git_url":"git://github.com/QoboLtd/cakephp-cms.git","ssh_url":"git@github.com:QoboLtd/cakephp-cms.git","clone_url":"https://github.com/QoboLtd/cakephp-cms.git","svn_url":"https://github.com/QoboLtd/cakephp-cms","homepage":null,"size":170,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/QoboLtd/cakephp-cms/pulls/53"},"html":{"href":"https://github.com/QoboLtd/cakephp-cms/pull/53"},"issue":{"href":"https://api.github.com/repos/QoboLtd/cakephp-cms/issues/53"},"comments":{"href":"https://api.github.com/repos/QoboLtd/cakephp-cms/issues/53/comments"},"review_comments":{"href":"https://api.github.com/repos/QoboLtd/cakephp-cms/pulls/53/comments"},"review_comment":{"href":"https://api.github.com/repos/QoboLtd/cakephp-cms/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/QoboLtd/cakephp-cms/pulls/53/commits"},"statuses":{"href":"https://api.github.com/repos/QoboLtd/cakephp-cms/statuses/da3e3d3ee779ad5cc80ec245629b166064e0e74b"}}}}
{"actor":{"display_login":"flangofas"}}