{"action":"created","comment":{"url":"https://api.github.com/repos/bolt/bolt/pulls/comments/39072620","id":39072620,"diff_hunk":"@@ -254,7 +254,25 @@ public function listing(Request $request, $contenttypeslug)\n             $amount = empty($contenttype['listing_records']) ? $this->getOption('general/listing_records') : $contenttype['listing_records'];\n         }\n         if (!$order = $this->getOption('theme/listing_sort', false)) {\n-            $order = empty($contenttype['sort']) ? $this->getOption('general/listing_sort') : $contenttype['sort'];\n+            $order = empty($contenttype['sort']) ? null : $contenttype['sort'];\n+        }\n+        // If $order is not set, one of two things can happen: Either we let `getContent()` sort by itself, or we\n+        // explicitly set it to sort on the general/listing_sort setting.\n+        if ($order === null) {\n+            $taxonomies = $this->getOption('taxonomy');\n+            $hassortorder = false;\n+            if (!empty($contenttype['taxonomy'])) {\n+                foreach($contenttype['taxonomy'] as $contenttypetaxonomy) {\n+                    if ($taxonomies[ $contenttypetaxonomy ]['has_sortorder']) {\n+                        // We have a taxonomy with a sortorder, so we must keep $order = false, in order\n+                        // to let `getContent()` handle it. We skip the fallback that's a few lines below.\n+                        $hassortorder = true;","path":"src/Controller/Frontend.php","position":17,"original_position":17,"commit_id":"ba1dfd1021e8be4477588c6412aa5631674fbd87","original_commit_id":"ba1dfd1021e8be4477588c6412aa5631674fbd87","user":{"login":"bobdenotter","id":1833361,"avatar_url":"https://avatars.githubusercontent.com/u/1833361?v=3","gravatar_id":"","url":"https://api.github.com/users/bobdenotter","html_url":"https://github.com/bobdenotter","followers_url":"https://api.github.com/users/bobdenotter/followers","following_url":"https://api.github.com/users/bobdenotter/following{/other_user}","gists_url":"https://api.github.com/users/bobdenotter/gists{/gist_id}","starred_url":"https://api.github.com/users/bobdenotter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bobdenotter/subscriptions","organizations_url":"https://api.github.com/users/bobdenotter/orgs","repos_url":"https://api.github.com/users/bobdenotter/repos","events_url":"https://api.github.com/users/bobdenotter/events{/privacy}","received_events_url":"https://api.github.com/users/bobdenotter/received_events","type":"User","site_admin":false},"body":"It throws the error, when i simply do this: \r\n\r\n```\r\n                    if ($taxonomies[ $contenttypetaxonomy ]['has_sortorder']) {\r\n                        // We have a taxonomy with a sortorder, so we must keep $order = false, in order\r\n                        // to let `getContent()` handle it. We skip the fallback that's a few lines below.\r\n                        $hassortorder = true;\r\n                        break 2;\r\n                    }\r\n```","created_at":"2015-09-09T17:36:37Z","updated_at":"2015-09-09T17:36:37Z","html_url":"https://github.com/bolt/bolt/pull/4073#discussion_r39072620","pull_request_url":"https://api.github.com/repos/bolt/bolt/pulls/4073","_links":{"self":{"href":"https://api.github.com/repos/bolt/bolt/pulls/comments/39072620"},"html":{"href":"https://github.com/bolt/bolt/pull/4073#discussion_r39072620"},"pull_request":{"href":"https://api.github.com/repos/bolt/bolt/pulls/4073"}}},"pull_request":{"url":"https://api.github.com/repos/bolt/bolt/pulls/4073","id":44566957,"html_url":"https://github.com/bolt/bolt/pull/4073","diff_url":"https://github.com/bolt/bolt/pull/4073.diff","patch_url":"https://github.com/bolt/bolt/pull/4073.patch","issue_url":"https://api.github.com/repos/bolt/bolt/issues/4073","number":4073,"state":"open","locked":false,"title":"Don't sort getContent in listing view, when the contenttype has a taxonomy that has a sortorder.","user":{"login":"bobdenotter","id":1833361,"avatar_url":"https://avatars.githubusercontent.com/u/1833361?v=3","gravatar_id":"","url":"https://api.github.com/users/bobdenotter","html_url":"https://github.com/bobdenotter","followers_url":"https://api.github.com/users/bobdenotter/followers","following_url":"https://api.github.com/users/bobdenotter/following{/other_user}","gists_url":"https://api.github.com/users/bobdenotter/gists{/gist_id}","starred_url":"https://api.github.com/users/bobdenotter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bobdenotter/subscriptions","organizations_url":"https://api.github.com/users/bobdenotter/orgs","repos_url":"https://api.github.com/users/bobdenotter/repos","events_url":"https://api.github.com/users/bobdenotter/events{/privacy}","received_events_url":"https://api.github.com/users/bobdenotter/received_events","type":"User","site_admin":false},"body":"Fixes #3977 ","created_at":"2015-09-09T15:48:20Z","updated_at":"2015-09-09T17:36:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bcfa6ac3c95ff721d75d582e2f960cc3992cf832","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/bolt/bolt/pulls/4073/commits","review_comments_url":"https://api.github.com/repos/bolt/bolt/pulls/4073/comments","review_comment_url":"https://api.github.com/repos/bolt/bolt/pulls/comments{/number}","comments_url":"https://api.github.com/repos/bolt/bolt/issues/4073/comments","statuses_url":"https://api.github.com/repos/bolt/bolt/statuses/ba1dfd1021e8be4477588c6412aa5631674fbd87","head":{"label":"bolt:fix/dont-sort-when-taxonomy-has-sort","ref":"fix/dont-sort-when-taxonomy-has-sort","sha":"ba1dfd1021e8be4477588c6412aa5631674fbd87","user":{"login":"bolt","id":3869752,"avatar_url":"https://avatars.githubusercontent.com/u/3869752?v=3","gravatar_id":"","url":"https://api.github.com/users/bolt","html_url":"https://github.com/bolt","followers_url":"https://api.github.com/users/bolt/followers","following_url":"https://api.github.com/users/bolt/following{/other_user}","gists_url":"https://api.github.com/users/bolt/gists{/gist_id}","starred_url":"https://api.github.com/users/bolt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bolt/subscriptions","organizations_url":"https://api.github.com/users/bolt/orgs","repos_url":"https://api.github.com/users/bolt/repos","events_url":"https://api.github.com/users/bolt/events{/privacy}","received_events_url":"https://api.github.com/users/bolt/received_events","type":"Organization","site_admin":false},"repo":{"id":4665416,"name":"bolt","full_name":"bolt/bolt","owner":{"login":"bolt","id":3869752,"avatar_url":"https://avatars.githubusercontent.com/u/3869752?v=3","gravatar_id":"","url":"https://api.github.com/users/bolt","html_url":"https://github.com/bolt","followers_url":"https://api.github.com/users/bolt/followers","following_url":"https://api.github.com/users/bolt/following{/other_user}","gists_url":"https://api.github.com/users/bolt/gists{/gist_id}","starred_url":"https://api.github.com/users/bolt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bolt/subscriptions","organizations_url":"https://api.github.com/users/bolt/orgs","repos_url":"https://api.github.com/users/bolt/repos","events_url":"https://api.github.com/users/bolt/events{/privacy}","received_events_url":"https://api.github.com/users/bolt/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/bolt/bolt","description":"Bolt is a simple CMS written in PHP. It is based on Silex and Symfony components, uses Twig and either SQLite, MySQL or PostgreSQL.","fork":false,"url":"https://api.github.com/repos/bolt/bolt","forks_url":"https://api.github.com/repos/bolt/bolt/forks","keys_url":"https://api.github.com/repos/bolt/bolt/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bolt/bolt/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bolt/bolt/teams","hooks_url":"https://api.github.com/repos/bolt/bolt/hooks","issue_events_url":"https://api.github.com/repos/bolt/bolt/issues/events{/number}","events_url":"https://api.github.com/repos/bolt/bolt/events","assignees_url":"https://api.github.com/repos/bolt/bolt/assignees{/user}","branches_url":"https://api.github.com/repos/bolt/bolt/branches{/branch}","tags_url":"https://api.github.com/repos/bolt/bolt/tags","blobs_url":"https://api.github.com/repos/bolt/bolt/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bolt/bolt/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bolt/bolt/git/refs{/sha}","trees_url":"https://api.github.com/repos/bolt/bolt/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bolt/bolt/statuses/{sha}","languages_url":"https://api.github.com/repos/bolt/bolt/languages","stargazers_url":"https://api.github.com/repos/bolt/bolt/stargazers","contributors_url":"https://api.github.com/repos/bolt/bolt/contributors","subscribers_url":"https://api.github.com/repos/bolt/bolt/subscribers","subscription_url":"https://api.github.com/repos/bolt/bolt/subscription","commits_url":"https://api.github.com/repos/bolt/bolt/commits{/sha}","git_commits_url":"https://api.github.com/repos/bolt/bolt/git/commits{/sha}","comments_url":"https://api.github.com/repos/bolt/bolt/comments{/number}","issue_comment_url":"https://api.github.com/repos/bolt/bolt/issues/comments{/number}","contents_url":"https://api.github.com/repos/bolt/bolt/contents/{+path}","compare_url":"https://api.github.com/repos/bolt/bolt/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bolt/bolt/merges","archive_url":"https://api.github.com/repos/bolt/bolt/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bolt/bolt/downloads","issues_url":"https://api.github.com/repos/bolt/bolt/issues{/number}","pulls_url":"https://api.github.com/repos/bolt/bolt/pulls{/number}","milestones_url":"https://api.github.com/repos/bolt/bolt/milestones{/number}","notifications_url":"https://api.github.com/repos/bolt/bolt/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bolt/bolt/labels{/name}","releases_url":"https://api.github.com/repos/bolt/bolt/releases{/id}","created_at":"2012-06-14T16:07:54Z","updated_at":"2015-09-08T20:05:42Z","pushed_at":"2015-09-09T15:48:21Z","git_url":"git://github.com/bolt/bolt.git","ssh_url":"git@github.com:bolt/bolt.git","clone_url":"https://github.com/bolt/bolt.git","svn_url":"https://github.com/bolt/bolt","homepage":"","size":68637,"stargazers_count":2276,"watchers_count":2276,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":507,"mirror_url":null,"open_issues_count":163,"forks":507,"open_issues":163,"watchers":2276,"default_branch":"master"}},"base":{"label":"bolt:master","ref":"master","sha":"5ec49d22b4366b72c6844ff090546dd952aeb8d5","user":{"login":"bolt","id":3869752,"avatar_url":"https://avatars.githubusercontent.com/u/3869752?v=3","gravatar_id":"","url":"https://api.github.com/users/bolt","html_url":"https://github.com/bolt","followers_url":"https://api.github.com/users/bolt/followers","following_url":"https://api.github.com/users/bolt/following{/other_user}","gists_url":"https://api.github.com/users/bolt/gists{/gist_id}","starred_url":"https://api.github.com/users/bolt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bolt/subscriptions","organizations_url":"https://api.github.com/users/bolt/orgs","repos_url":"https://api.github.com/users/bolt/repos","events_url":"https://api.github.com/users/bolt/events{/privacy}","received_events_url":"https://api.github.com/users/bolt/received_events","type":"Organization","site_admin":false},"repo":{"id":4665416,"name":"bolt","full_name":"bolt/bolt","owner":{"login":"bolt","id":3869752,"avatar_url":"https://avatars.githubusercontent.com/u/3869752?v=3","gravatar_id":"","url":"https://api.github.com/users/bolt","html_url":"https://github.com/bolt","followers_url":"https://api.github.com/users/bolt/followers","following_url":"https://api.github.com/users/bolt/following{/other_user}","gists_url":"https://api.github.com/users/bolt/gists{/gist_id}","starred_url":"https://api.github.com/users/bolt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bolt/subscriptions","organizations_url":"https://api.github.com/users/bolt/orgs","repos_url":"https://api.github.com/users/bolt/repos","events_url":"https://api.github.com/users/bolt/events{/privacy}","received_events_url":"https://api.github.com/users/bolt/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/bolt/bolt","description":"Bolt is a simple CMS written in PHP. It is based on Silex and Symfony components, uses Twig and either SQLite, MySQL or PostgreSQL.","fork":false,"url":"https://api.github.com/repos/bolt/bolt","forks_url":"https://api.github.com/repos/bolt/bolt/forks","keys_url":"https://api.github.com/repos/bolt/bolt/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bolt/bolt/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bolt/bolt/teams","hooks_url":"https://api.github.com/repos/bolt/bolt/hooks","issue_events_url":"https://api.github.com/repos/bolt/bolt/issues/events{/number}","events_url":"https://api.github.com/repos/bolt/bolt/events","assignees_url":"https://api.github.com/repos/bolt/bolt/assignees{/user}","branches_url":"https://api.github.com/repos/bolt/bolt/branches{/branch}","tags_url":"https://api.github.com/repos/bolt/bolt/tags","blobs_url":"https://api.github.com/repos/bolt/bolt/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bolt/bolt/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bolt/bolt/git/refs{/sha}","trees_url":"https://api.github.com/repos/bolt/bolt/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bolt/bolt/statuses/{sha}","languages_url":"https://api.github.com/repos/bolt/bolt/languages","stargazers_url":"https://api.github.com/repos/bolt/bolt/stargazers","contributors_url":"https://api.github.com/repos/bolt/bolt/contributors","subscribers_url":"https://api.github.com/repos/bolt/bolt/subscribers","subscription_url":"https://api.github.com/repos/bolt/bolt/subscription","commits_url":"https://api.github.com/repos/bolt/bolt/commits{/sha}","git_commits_url":"https://api.github.com/repos/bolt/bolt/git/commits{/sha}","comments_url":"https://api.github.com/repos/bolt/bolt/comments{/number}","issue_comment_url":"https://api.github.com/repos/bolt/bolt/issues/comments{/number}","contents_url":"https://api.github.com/repos/bolt/bolt/contents/{+path}","compare_url":"https://api.github.com/repos/bolt/bolt/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bolt/bolt/merges","archive_url":"https://api.github.com/repos/bolt/bolt/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bolt/bolt/downloads","issues_url":"https://api.github.com/repos/bolt/bolt/issues{/number}","pulls_url":"https://api.github.com/repos/bolt/bolt/pulls{/number}","milestones_url":"https://api.github.com/repos/bolt/bolt/milestones{/number}","notifications_url":"https://api.github.com/repos/bolt/bolt/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bolt/bolt/labels{/name}","releases_url":"https://api.github.com/repos/bolt/bolt/releases{/id}","created_at":"2012-06-14T16:07:54Z","updated_at":"2015-09-08T20:05:42Z","pushed_at":"2015-09-09T15:48:21Z","git_url":"git://github.com/bolt/bolt.git","ssh_url":"git@github.com:bolt/bolt.git","clone_url":"https://github.com/bolt/bolt.git","svn_url":"https://github.com/bolt/bolt","homepage":"","size":68637,"stargazers_count":2276,"watchers_count":2276,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":507,"mirror_url":null,"open_issues_count":163,"forks":507,"open_issues":163,"watchers":2276,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/bolt/bolt/pulls/4073"},"html":{"href":"https://github.com/bolt/bolt/pull/4073"},"issue":{"href":"https://api.github.com/repos/bolt/bolt/issues/4073"},"comments":{"href":"https://api.github.com/repos/bolt/bolt/issues/4073/comments"},"review_comments":{"href":"https://api.github.com/repos/bolt/bolt/pulls/4073/comments"},"review_comment":{"href":"https://api.github.com/repos/bolt/bolt/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/bolt/bolt/pulls/4073/commits"},"statuses":{"href":"https://api.github.com/repos/bolt/bolt/statuses/ba1dfd1021e8be4477588c6412aa5631674fbd87"}}}}