{"action":"created","issue":{"url":"https://api.github.com/repos/api-platform/core/issues/1693","repository_url":"https://api.github.com/repos/api-platform/core","labels_url":"https://api.github.com/repos/api-platform/core/issues/1693/labels{/name}","comments_url":"https://api.github.com/repos/api-platform/core/issues/1693/comments","events_url":"https://api.github.com/repos/api-platform/core/issues/1693/events","html_url":"https://github.com/api-platform/core/issues/1693","id":295593052,"number":1693,"title":"Broken order filter since #1633","user":{"login":"jdeniau","id":1398469,"avatar_url":"https://avatars1.githubusercontent.com/u/1398469?v=4","gravatar_id":"","url":"https://api.github.com/users/jdeniau","html_url":"https://github.com/jdeniau","followers_url":"https://api.github.com/users/jdeniau/followers","following_url":"https://api.github.com/users/jdeniau/following{/other_user}","gists_url":"https://api.github.com/users/jdeniau/gists{/gist_id}","starred_url":"https://api.github.com/users/jdeniau/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdeniau/subscriptions","organizations_url":"https://api.github.com/users/jdeniau/orgs","repos_url":"https://api.github.com/users/jdeniau/repos","events_url":"https://api.github.com/users/jdeniau/events{/privacy}","received_events_url":"https://api.github.com/users/jdeniau/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-02-08T17:07:49Z","updated_at":"2018-02-09T08:20:18Z","closed_at":"2018-02-08T17:19:20Z","author_association":"CONTRIBUTOR","body":"I tried to update to 2.2.0-beta but the `?order[foo]=DESC` does not seems to works anymore. The order is not set in the query anymore.\r\n\r\nI bisected api-platform and the commit breaking this is 63d555ae (PR #1633 )\r\n\r\nI investigated a little and it seems that the doctrine query is OK in `FilterExtension` after `applyToCollection` method call, but is not present is symfony's debug toolbar.\r\n\r\nIf you have an idea @dunglas ?"},"comment":{"url":"https://api.github.com/repos/api-platform/core/issues/comments/364365973","html_url":"https://github.com/api-platform/core/issues/1693#issuecomment-364365973","issue_url":"https://api.github.com/repos/api-platform/core/issues/1693","id":364365973,"user":{"login":"jdeniau","id":1398469,"avatar_url":"https://avatars1.githubusercontent.com/u/1398469?v=4","gravatar_id":"","url":"https://api.github.com/users/jdeniau","html_url":"https://github.com/jdeniau","followers_url":"https://api.github.com/users/jdeniau/followers","following_url":"https://api.github.com/users/jdeniau/following{/other_user}","gists_url":"https://api.github.com/users/jdeniau/gists{/gist_id}","starred_url":"https://api.github.com/users/jdeniau/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdeniau/subscriptions","organizations_url":"https://api.github.com/users/jdeniau/orgs","repos_url":"https://api.github.com/users/jdeniau/repos","events_url":"https://api.github.com/users/jdeniau/events{/privacy}","received_events_url":"https://api.github.com/users/jdeniau/received_events","type":"User","site_admin":false},"created_at":"2018-02-09T08:20:18Z","updated_at":"2018-02-09T08:20:18Z","author_association":"CONTRIBUTOR","body":"For the record in case someone need help with this too:\r\n\r\nI had a custom method in a custom controller to `applyFilters` that needed this change:\r\n\r\n```diff\r\n    protected function applyFilters(string $resourceClass, QueryBuilder $queryBuilder)\r\n    {\r\n        $metadata = $this->get('api_platform.metadata.resource.metadata_factory')->create($resourceClass);\r\n\r\n        $filterList = $metadata->getAttribute('filters');\r\n\r\n        if (!empty($filterList)) {\r\n+           $request = $this->get('request_stack')->getMasterRequest();\r\n            $queryNameGenerator = new QueryNameGenerator();\r\n            $operationName = 'get';\r\n\r\n            foreach ($filterList as $filter) {\r\n                $extension = $this->get($filter);\r\n\r\n                $extension->apply(\r\n                    $queryBuilder,\r\n                    $queryNameGenerator,\r\n                    $resourceClass,\r\n-                   $operationName\r\n+                   $operationName,\r\n+                   ['filters' => $request->query->all()]\r\n                );\r\n            }\r\n        }\r\n    }\r\n```"}}
{"actor":{"display_login":"jdeniau"}}