mirror of
https://github.com/flarum/core.git
synced 2025-08-06 08:27:42 +02:00
fix: multiple createdAt columns in query causes conflicts (#3506)
* test: list posts with mentions filter and `createdAt` sort * fix: multiple `createdAt` columns in query causes conflicts * chore: link to pull request for context Signed-off-by: Sami Mazouz <ilyasmazouz@gmail.com>
This commit is contained in:
@@ -113,6 +113,20 @@ class ListPostsController extends AbstractListController
|
||||
return $results;
|
||||
}
|
||||
|
||||
/**
|
||||
* @link https://github.com/flarum/framework/pull/3506
|
||||
*/
|
||||
protected function extractSort(ServerRequestInterface $request)
|
||||
{
|
||||
$sort = [];
|
||||
|
||||
foreach ((parent::extractSort($request) ?: []) as $field => $direction) {
|
||||
$sort["posts.$field"] = $direction;
|
||||
}
|
||||
|
||||
return $sort;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
|
Reference in New Issue
Block a user