diff --git a/src/Models/SearchParsers/AbstractSearchParser.php b/src/Models/SearchParsers/AbstractSearchParser.php index efcb9700..33e69c9a 100644 --- a/src/Models/SearchParsers/AbstractSearchParser.php +++ b/src/Models/SearchParsers/AbstractSearchParser.php @@ -28,7 +28,7 @@ abstract class AbstractSearchParser list ($key, $value) = explode(':', $token, 2); $key = strtolower($key); - if ($key == 'order') + if ($key == 'order' or $key == 'sort') { $this->internalProcessOrderToken($value, $neg); } diff --git a/tests/Tests/JobTests/ListPostsJobTest.php b/tests/Tests/JobTests/ListPostsJobTest.php index 9751cf8e..d5a6fe6e 100644 --- a/tests/Tests/JobTests/ListPostsJobTest.php +++ b/tests/Tests/JobTests/ListPostsJobTest.php @@ -602,6 +602,14 @@ class ListPostsJobTest extends AbstractTest $this->testOrder('order:id', [$posts[2], $posts[1], $posts[0]]); } + public function testOrderByIdUsingAlternativeKeyword() + { + $this->grantAccess('listPosts'); + $posts = $this->preparePostsWithTags(); + + $this->testOrder('sort:id', [$posts[2], $posts[1], $posts[0]]); + } + public function testOrderByFavCount() { $this->grantAccess('listPosts');