From 4bc6ef346ab28025d613d308da84812325f4c7ce Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Fri, 14 Jun 2019 10:34:37 +0200 Subject: [PATCH] Fix `getBuilderForUntaggedByUser` --- src/Wallabag/CoreBundle/Repository/EntryRepository.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Wallabag/CoreBundle/Repository/EntryRepository.php b/src/Wallabag/CoreBundle/Repository/EntryRepository.php index aa761df3..347e1b97 100644 --- a/src/Wallabag/CoreBundle/Repository/EntryRepository.php +++ b/src/Wallabag/CoreBundle/Repository/EntryRepository.php @@ -122,13 +122,17 @@ class EntryRepository extends EntityRepository /** * Retrieve a sorted list of untagged entries for a user. * - * @param int $userId + * @param int $userId + * @param string $sortBy Field to sort + * @param string $direction Direction of the order * * @return QueryBuilder */ - public function getBuilderForUntaggedByUser($userId) + public function getBuilderForUntaggedByUser($userId, $sortBy = 'starredAt', $direction = 'DESC') { - return $this->sortQueryBuilder($this->getRawBuilderForUntaggedByUser($userId)); + $sortBy = $sortBy ?: 'id'; + + return $this->sortQueryBuilder($this->getRawBuilderForUntaggedByUser($userId), $sortBy, $direction); } /** -- 2.41.0