From db06f97457092e7dfe8930f4091f876c932d5bd9 Mon Sep 17 00:00:00 2001 From: andresbautista Date: Tue, 17 Dec 2024 12:04:27 +0100 Subject: [PATCH] chore: add array filter in sortableFields settings --- src/Traits/GenericActionsTrait.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Traits/GenericActionsTrait.php b/src/Traits/GenericActionsTrait.php index 9113d66..2a29b67 100644 --- a/src/Traits/GenericActionsTrait.php +++ b/src/Traits/GenericActionsTrait.php @@ -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))), ], ]); }