Skip to content

Commit

Permalink
chore: add array filter in sortableFields settings
Browse files Browse the repository at this point in the history
  • Loading branch information
andresbautista committed Dec 17, 2024
1 parent fd16a0e commit db06f97
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Traits/GenericActionsTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,13 @@ protected function loadFilteredChildren(Folder $folder): array

$settings = Hash::merge($this->paginate, [
'order' => $order,
'sortableFields' => array_merge($this->paginate['sortableFields'] ?? (array)$this->request->getQuery('sort'), array_keys($order)),
'sortableFields' => array_filter(array_merge($this->paginate['sortableFields'] ?? (array)$this->request->getQuery('sort'), array_keys($order))),
]);
if (isset($settings['Children'])) {
$settings = Hash::merge($settings, [
'Children' => [
'order' => $order,
'sortableFields' => array_merge($this->paginate['Children']['sortableFields'] ?? (array)$this->request->getQuery('sort'), array_keys($order)),
'sortableFields' => array_filter(array_merge($this->paginate['Children']['sortableFields'] ?? (array)$this->request->getQuery('sort'), array_keys($order))),
],
]);
}
Expand Down

0 comments on commit db06f97

Please sign in to comment.