GitHub PullRequestReviewCommentEvent at 2014-09-24 13:51:02
Repository: SuluContentBundle
Actor: danrot
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/sulu-cmf/SuluContentBundle/pulls/comments/17971876","id":17971876,"diff_hunk":"@@ -116,11 +116,15 @@ private function buildOrderClauses($languageCode)\n     {\n         $sql2Order = array();\n         $sortBy = $this->getConfig('sortBy', array());\n-        if (!empty($sortBy) && is_array($sortBy)) {\n+\n+        // if no order given, order by the sulu:order property\n+        if (empty($sortBy)) {\n+            $sql2Order[] = 'c.[sulu:order]';\n+        } elseif (is_array($sortBy)) {\n             foreach ($this->getConfig('sortBy', array()) as $sortColumn) {\n-                // TODO implement more generic\n                 $order = 'c.[i18n:' . $languageCode . '-' . $sortColumn . ']';\n-                if (!in_array($sortColumn, array('published', 'created', 'changed'))) {\n+\n+                if (false === in_array($sortColumn, array('published', 'created', 'changed'))) {","path":"Repository/FilterNodesQueryBuilder.php","position":15,"original_position":15,"commit_id":"1d2014d274e3447a8b9f4ed023ffb42bc4bd2705","original_commit_id":"01fb0ee866c872dd1c0ad3818cbf7ef788f7dd51","user":{"login":"danrot","id":405874,"avatar_url":"https://avatars.githubusercontent.com/u/405874?v=2","gravatar_id":"","url":"https://api.github.com/users/danrot","html_url":"https://github.com/danrot","followers_url":"https://api.github.com/users/danrot/followers","following_url":"https://api.github.com/users/danrot/following{/other_user}","gists_url":"https://api.github.com/users/danrot/gists{/gist_id}","starred_url":"https://api.github.com/users/danrot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danrot/subscriptions","organizations_url":"https://api.github.com/users/danrot/orgs","repos_url":"https://api.github.com/users/danrot/repos","events_url":"https://api.github.com/users/danrot/events{/privacy}","received_events_url":"https://api.github.com/users/danrot/received_events","type":"User","site_admin":false},"body":"I would prefer to change it, IMHO it's easier to read, and we can rely on the `in_array`-method to return a boolean.","created_at":"2014-09-24T13:51:02Z","updated_at":"2014-09-24T13:51:02Z","html_url":"https://github.com/sulu-cmf/SuluContentBundle/pull/247#discussion_r17971876","pull_request_url":"https://api.github.com/repos/sulu-cmf/SuluContentBundle/pulls/247","_links":{"self":{"href":"https://api.github.com/repos/sulu-cmf/SuluContentBundle/pulls/comments/17971876"},"html":{"href":"https://github.com/sulu-cmf/SuluContentBundle/pull/247#discussion_r17971876"},"pull_request":{"href":"https://api.github.com/repos/sulu-cmf/SuluContentBundle/pulls/247"}}},"pull_request":{"url":"https://api.github.com/repos/sulu-cmf/SuluContentBundle/pulls/247","id":21696945,"html_url":"https://github.com/sulu-cmf/SuluContentBundle/pull/247","diff_url":"https://github.com/sulu-cmf/SuluContentBundle/pull/247.diff","patch_url":"https://github.com/sulu-cmf/SuluContentBundle/pull/247.patch","issue_url":"https://api.github.com/repos/sulu-cmf/SuluContentBundle/issues/247","number":247,"state":"open","locked":false,"title":"[FEATURE] Updated to order by [sulu:order] by default","user":{"login":"dantleech","id":530801,"avatar_url":"https://avatars.githubusercontent.com/u/530801?v=2","gravatar_id":"","url":"https://api.github.com/users/dantleech","html_url":"https://github.com/dantleech","followers_url":"https://api.github.com/users/dantleech/followers","following_url":"https://api.github.com/users/dantleech/following{/other_user}","gists_url":"https://api.github.com/users/dantleech/gists{/gist_id}","starred_url":"https://api.github.com/users/dantleech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dantleech/subscriptions","organizations_url":"https://api.github.com/users/dantleech/orgs","repos_url":"https://api.github.com/users/dantleech/repos","events_url":"https://api.github.com/users/dantleech/events{/privacy}","received_events_url":"https://api.github.com/users/dantleech/received_events","type":"User","site_admin":false},"body":"This PR will make the FilerNodesQueryBuilder sort by [sulu:order] by default. This change is BC compatible as it does not matter if this column does not exist.","created_at":"2014-09-24T07:43:53Z","updated_at":"2014-09-24T13:51:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f0168e22885712d60e3e01b130049c3cd02489ff","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/sulu-cmf/SuluContentBundle/pulls/247/commits","review_comments_url":"https://api.github.com/repos/sulu-cmf/SuluContentBundle/pulls/247/comments","review_comment_url":"https://api.github.com/repos/sulu-cmf/SuluContentBundle/pulls/comments/{number}","comments_url":"https://api.github.com/repos/sulu-cmf/SuluContentBundle/issues/247/comments","statuses_url":"https://api.github.com/repos/sulu-cmf/SuluContentBundle/statuses/1d2014d274e3447a8b9f4ed023ffb42bc4bd2705","head":{"label":"sulu-cmf:feature/added-order-by-sulu-order","ref":"feature/added-order-by-sulu-order","sha":"1d2014d274e3447a8b9f4ed023ffb42bc4bd2705","user":{"login":"sulu-cmf","id":5717006,"avatar_url":"https://avatars.githubusercontent.com/u/5717006?v=2","gravatar_id":"","url":"https://api.github.com/users/sulu-cmf","html_url":"https://github.com/sulu-cmf","followers_url":"https://api.github.com/users/sulu-cmf/followers","following_url":"https://api.github.com/users/sulu-cmf/following{/other_user}","gists_url":"https://api.github.com/users/sulu-cmf/gists{/gist_id}","starred_url":"https://api.github.com/users/sulu-cmf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sulu-cmf/subscriptions","organizations_url":"https://api.github.com/users/sulu-cmf/orgs","repos_url":"https://api.github.com/users/sulu-cmf/repos","events_url":"https://api.github.com/users/sulu-cmf/events{/privacy}","received_events_url":"https://api.github.com/users/sulu-cmf/received_events","type":"Organization","site_admin":false},"repo":{"id":13540868,"name":"SuluContentBundle","full_name":"sulu-cmf/SuluContentBundle","owner":{"login":"sulu-cmf","id":5717006,"avatar_url":"https://avatars.githubusercontent.com/u/5717006?v=2","gravatar_id":"","url":"https://api.github.com/users/sulu-cmf","html_url":"https://github.com/sulu-cmf","followers_url":"https://api.github.com/users/sulu-cmf/followers","following_url":"https://api.github.com/users/sulu-cmf/following{/other_user}","gists_url":"https://api.github.com/users/sulu-cmf/gists{/gist_id}","starred_url":"https://api.github.com/users/sulu-cmf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sulu-cmf/subscriptions","organizations_url":"https://api.github.com/users/sulu-cmf/orgs","repos_url":"https://api.github.com/users/sulu-cmf/repos","events_url":"https://api.github.com/users/sulu-cmf/events{/privacy}","received_events_url":"https://api.github.com/users/sulu-cmf/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sulu-cmf/SuluContentBundle","description":"","fork":false,"url":"https://api.github.com/repos/sulu-cmf/SuluContentBundle","forks_url":"https://api.github.com/repos/sulu-cmf/SuluContentBundle/forks","keys_url":"https://api.github.com/repos/sulu-cmf/SuluContentBundle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sulu-cmf/SuluContentBundle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sulu-cmf/SuluContentBundle/teams","hooks_url":"https://api.github.com/repos/sulu-cmf/SuluContentBundle/hooks","issue_events_url":"https://api.github.com/repos/sulu-cmf/SuluContentBundle/issues/events{/number}","events_url":"https://api.github.com/repos/sulu-cmf/SuluContentBundle/events","assignees_url":"https://api.github.com/repos/sulu-cmf/SuluContentBundle/assignees{/user}","branches_url":"https://api.github.com/repos/sulu-cmf/SuluContentBundle/branches{/branch}","tags_url":"https://api.github.com/repos/sulu-cmf/SuluContentBundle/tags","blobs_url":"https://api.github.com/repos/sulu-cmf/SuluContentBundle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sulu-cmf/SuluContentBundle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sulu-cmf/SuluContentBundle/git/refs{/sha}","trees_url":"https://api.github.com/repos/sulu-cmf/SuluContentBundle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sulu-cmf/SuluContentBundle/statuses/{sha}","languages_url":"https://api.github.com/repos/sulu-cmf/SuluContentBundle/languages","stargazers_url":"https://api.github.com/repos/sulu-cmf/SuluContentBundle/stargazers","contributors_url":"https://api.github.com/repos/sulu-cmf/SuluContentBundle/contributors","subscribers_url":"https://api.github.com/repos/sulu-cmf/SuluContentBundle/subscribers","subscription_url":"https://api.github.com/repos/sulu-cmf/SuluContentBundle/subscription","commits_url":"https://api.github.com/repos/sulu-cmf/SuluContentBundle/commits{/sha}","git_commits_url":"https://api.github.com/repos/sulu-cmf/SuluContentBundle/git/commits{/sha}","comments_url":"https://api.github.com/repos/sulu-cmf/SuluContentBundle/comments{/number}","issue_comment_url":"https://api.github.com/repos/sulu-cmf/SuluContentBundle/issues/comments/{number}","contents_url":"https://api.github.com/repos/sulu-cmf/SuluContentBundle/contents/{+path}","compare_url":"https://api.github.com/repos/sulu-cmf/SuluContentBundle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sulu-cmf/SuluContentBundle/merges","archive_url":"https://api.github.com/repos/sulu-cmf/SuluContentBundle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sulu-cmf/SuluContentBundle/downloads","issues_url":"https://api.github.com/repos/sulu-cmf/SuluContentBundle/issues{/number}","pulls_url":"https://api.github.com/repos/sulu-cmf/SuluContentBundle/pulls{/number}","milestones_url":"https://api.github.com/repos/sulu-cmf/SuluContentBundle/milestones{/number}","notifications_url":"https://api.github.com/repos/sulu-cmf/SuluContentBundle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sulu-cmf/SuluContentBundle/labels{/name}","releases_url":"https://api.github.com/repos/sulu-cmf/SuluContentBundle/releases{/id}","created_at":"2013-10-13T14:48:28Z","updated_at":"2014-09-02T08:50:32Z","pushed_at":"2014-09-24T13:03:01Z","git_url":"git://github.com/sulu-cmf/SuluContentBundle.git","ssh_url":"git@github.com:sulu-cmf/SuluContentBundle.git","clone_url":"https://github.com/sulu-cmf/SuluContentBundle.git","svn_url":"https://github.com/sulu-cmf/SuluContentBundle","homepage":null,"size":10544,"stargazers_count":2,"watchers_count":2,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":37,"forks":0,"open_issues":37,"watchers":2,"default_branch":"develop"}},"base":{"label":"sulu-cmf:develop","ref":"develop","sha":"1f50c7fbad074369979cac674fb6da0b9e67a19f","user":{"login":"sulu-cmf","id":5717006,"avatar_url":"https://avatars.githubusercontent.com/u/5717006?v=2","gravatar_id":"","url":"https://api.github.com/users/sulu-cmf","html_url":"https://github.com/sulu-cmf","followers_url":"https://api.github.com/users/sulu-cmf/followers","following_url":"https://api.github.com/users/sulu-cmf/following{/other_user}","gists_url":"https://api.github.com/users/sulu-cmf/gists{/gist_id}","starred_url":"https://api.github.com/users/sulu-cmf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sulu-cmf/subscriptions","organizations_url":"https://api.github.com/users/sulu-cmf/orgs","repos_url":"https://api.github.com/users/sulu-cmf/repos","events_url":"https://api.github.com/users/sulu-cmf/events{/privacy}","received_events_url":"https://api.github.com/users/sulu-cmf/received_events","type":"Organization","site_admin":false},"repo":{"id":13540868,"name":"SuluContentBundle","full_name":"sulu-cmf/SuluContentBundle","owner":{"login":"sulu-cmf","id":5717006,"avatar_url":"https://avatars.githubusercontent.com/u/5717006?v=2","gravatar_id":"","url":"https://api.github.com/users/sulu-cmf","html_url":"https://github.com/sulu-cmf","followers_url":"https://api.github.com/users/sulu-cmf/followers","following_url":"https://api.github.com/users/sulu-cmf/following{/other_user}","gists_url":"https://api.github.com/users/sulu-cmf/gists{/gist_id}","starred_url":"https://api.github.com/users/sulu-cmf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sulu-cmf/subscriptions","organizations_url":"https://api.github.com/users/sulu-cmf/orgs","repos_url":"https://api.github.com/users/sulu-cmf/repos","events_url":"https://api.github.com/users/sulu-cmf/events{/privacy}","received_events_url":"https://api.github.com/users/sulu-cmf/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sulu-cmf/SuluContentBundle","description":"","fork":false,"url":"https://api.github.com/repos/sulu-cmf/SuluContentBundle","forks_url":"https://api.github.com/repos/sulu-cmf/SuluContentBundle/forks","keys_url":"https://api.github.com/repos/sulu-cmf/SuluContentBundle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sulu-cmf/SuluContentBundle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sulu-cmf/SuluContentBundle/teams","hooks_url":"https://api.github.com/repos/sulu-cmf/SuluContentBundle/hooks","issue_events_url":"https://api.github.com/repos/sulu-cmf/SuluContentBundle/issues/events{/number}","events_url":"https://api.github.com/repos/sulu-cmf/SuluContentBundle/events","assignees_url":"https://api.github.com/repos/sulu-cmf/SuluContentBundle/assignees{/user}","branches_url":"https://api.github.com/repos/sulu-cmf/SuluContentBundle/branches{/branch}","tags_url":"https://api.github.com/repos/sulu-cmf/SuluContentBundle/tags","blobs_url":"https://api.github.com/repos/sulu-cmf/SuluContentBundle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sulu-cmf/SuluContentBundle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sulu-cmf/SuluContentBundle/git/refs{/sha}","trees_url":"https://api.github.com/repos/sulu-cmf/SuluContentBundle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sulu-cmf/SuluContentBundle/statuses/{sha}","languages_url":"https://api.github.com/repos/sulu-cmf/SuluContentBundle/languages","stargazers_url":"https://api.github.com/repos/sulu-cmf/SuluContentBundle/stargazers","contributors_url":"https://api.github.com/repos/sulu-cmf/SuluContentBundle/contributors","subscribers_url":"https://api.github.com/repos/sulu-cmf/SuluContentBundle/subscribers","subscription_url":"https://api.github.com/repos/sulu-cmf/SuluContentBundle/subscription","commits_url":"https://api.github.com/repos/sulu-cmf/SuluContentBundle/commits{/sha}","git_commits_url":"https://api.github.com/repos/sulu-cmf/SuluContentBundle/git/commits{/sha}","comments_url":"https://api.github.com/repos/sulu-cmf/SuluContentBundle/comments{/number}","issue_comment_url":"https://api.github.com/repos/sulu-cmf/SuluContentBundle/issues/comments/{number}","contents_url":"https://api.github.com/repos/sulu-cmf/SuluContentBundle/contents/{+path}","compare_url":"https://api.github.com/repos/sulu-cmf/SuluContentBundle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sulu-cmf/SuluContentBundle/merges","archive_url":"https://api.github.com/repos/sulu-cmf/SuluContentBundle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sulu-cmf/SuluContentBundle/downloads","issues_url":"https://api.github.com/repos/sulu-cmf/SuluContentBundle/issues{/number}","pulls_url":"https://api.github.com/repos/sulu-cmf/SuluContentBundle/pulls{/number}","milestones_url":"https://api.github.com/repos/sulu-cmf/SuluContentBundle/milestones{/number}","notifications_url":"https://api.github.com/repos/sulu-cmf/SuluContentBundle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sulu-cmf/SuluContentBundle/labels{/name}","releases_url":"https://api.github.com/repos/sulu-cmf/SuluContentBundle/releases{/id}","created_at":"2013-10-13T14:48:28Z","updated_at":"2014-09-02T08:50:32Z","pushed_at":"2014-09-24T13:03:01Z","git_url":"git://github.com/sulu-cmf/SuluContentBundle.git","ssh_url":"git@github.com:sulu-cmf/SuluContentBundle.git","clone_url":"https://github.com/sulu-cmf/SuluContentBundle.git","svn_url":"https://github.com/sulu-cmf/SuluContentBundle","homepage":null,"size":10544,"stargazers_count":2,"watchers_count":2,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":37,"forks":0,"open_issues":37,"watchers":2,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/sulu-cmf/SuluContentBundle/pulls/247"},"html":{"href":"https://github.com/sulu-cmf/SuluContentBundle/pull/247"},"issue":{"href":"https://api.github.com/repos/sulu-cmf/SuluContentBundle/issues/247"},"comments":{"href":"https://api.github.com/repos/sulu-cmf/SuluContentBundle/issues/247/comments"},"review_comments":{"href":"https://api.github.com/repos/sulu-cmf/SuluContentBundle/pulls/247/comments"},"review_comment":{"href":"https://api.github.com/repos/sulu-cmf/SuluContentBundle/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/sulu-cmf/SuluContentBundle/pulls/247/commits"},"statuses":{"href":"https://api.github.com/repos/sulu-cmf/SuluContentBundle/statuses/1d2014d274e3447a8b9f4ed023ffb42bc4bd2705"}}}}