We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 3adfd9e + 33c4226 commit 9a8b63eCopy full SHA for 9a8b63e
Subscriber/PaginateElasticaQuerySubscriber.php
@@ -62,10 +62,19 @@ protected function setSorting(ItemsEvent $event)
62
$options = $event->options;
63
$sortField = $this->request->get($options['sortFieldParameterName']);
64
65
+ if (!$sortField && isset($options['defaultSortFieldName'])) {
66
+ $sortField = $options['defaultSortFieldName'];
67
+ }
68
+
69
if (!empty($sortField)) {
70
// determine sort direction
71
$dir = 'asc';
72
$sortDirection = $this->request->get($options['sortDirectionParameterName']);
73
74
+ if (!$sortDirection && isset($options['defaultSortDirection'])) {
75
+ $sortDirection = $options['defaultSortDirection'];
76
77
78
if ('desc' === strtolower($sortDirection)) {
79
$dir = 'desc';
80
}
0 commit comments