{"action":"opened","issue":{"url":"https://api.github.com/repos/api-platform/core/issues/780","repository_url":"https://api.github.com/repos/api-platform/core","labels_url":"https://api.github.com/repos/api-platform/core/issues/780/labels{/name}","comments_url":"https://api.github.com/repos/api-platform/core/issues/780/comments","events_url":"https://api.github.com/repos/api-platform/core/issues/780/events","html_url":"https://github.com/api-platform/core/issues/780","id":180245948,"number":780,"title":"[Filter] Default order doesn't applied","user":{"login":"Eraac","id":5497623,"avatar_url":"https://avatars.githubusercontent.com/u/5497623?v=3","gravatar_id":"","url":"https://api.github.com/users/Eraac","html_url":"https://github.com/Eraac","followers_url":"https://api.github.com/users/Eraac/followers","following_url":"https://api.github.com/users/Eraac/following{/other_user}","gists_url":"https://api.github.com/users/Eraac/gists{/gist_id}","starred_url":"https://api.github.com/users/Eraac/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Eraac/subscriptions","organizations_url":"https://api.github.com/users/Eraac/orgs","repos_url":"https://api.github.com/users/Eraac/repos","events_url":"https://api.github.com/users/Eraac/events{/privacy}","received_events_url":"https://api.github.com/users/Eraac/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-09-30T08:15:10Z","updated_at":"2016-09-30T08:15:10Z","closed_at":null,"body":"Hi,\r\n\r\nAccording to the doc for the order filter ([here](https://github.com/api-platform/docs/blob/master/core/filters.md)),\r\n\r\n> By default, whenever the query does not specify the direction explicitly (e.g: /offers?order[name]&order[id]), filters will not be applied unless you configure a default order direction to use:\r\n\r\nSo, I guess with this configuration:\r\n\r\n```yaml\r\nhistory.order_filter:\r\n    parent:    'api_platform.doctrine.orm.order_filter'\r\n    arguments: [ { createdAt: 'desc' } ]\r\n    tags:      [ { name: 'api_platform.filter', id: 'history.order' } ]\r\n```\r\nWhen I request /histories, i shoud have the latest history in first, right? But actually in my code I haven't this behaviour.\r\n\r\nMaybe isn't a bug, and I have a lack of comprehension of the doc, but for me it's make sense to have a default order directly in configuration.\r\n\r\nIt just change one line in [OrderFilter.php:109](https://github.com/api-platform/core/blob/master/src/Bridge/Doctrine/Orm/Filter/OrderFilter.php#L109)\r\n\r\nFrom:\r\n```php\r\nreturn $request->query->get($this->orderParameterName, []);\r\n```\r\nTo:\r\n```php\r\nreturn $request->query->get($this->orderParameterName, $this->properties);\r\n```\r\n\r\nI use :\r\n* Symfony 3.1.*\r\n* Api-Platform ^2.0@rc\r\n* PHP 7.0.11"}}
{"actor":{"display_login":"Eraac"}}