From fb7d65d645efabe74e8ae9981866b2057f0000ea Mon Sep 17 00:00:00 2001 From: Michael Kaufmann Date: Sun, 8 Jan 2023 19:01:10 +0100 Subject: [PATCH] need pagination-context for sortfields; only disable pagination-code on view Signed-off-by: Michael Kaufmann --- lib/Froxlor/UI/Pagination.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Froxlor/UI/Pagination.php b/lib/Froxlor/UI/Pagination.php index 7a187613..62e0677e 100644 --- a/lib/Froxlor/UI/Pagination.php +++ b/lib/Froxlor/UI/Pagination.php @@ -203,15 +203,15 @@ class Pagination public function getApiResponseParams(): array { return [ - 'pagination' => (Settings::Get('panel.paging') > 0) ? [ + 'pagination' => [ "total" => $this->entries, "per_page" => $this->perPage, "current_page" => $this->pageno, - "last_page" => ceil($this->entries / $this->perPage), + "last_page" => (Settings::Get('panel.paging') > 0) ? ceil($this->entries / $this->perPage) : -1, "from" => $this->data['sql_offset'] ?? null, "to" => min($this->data['sql_offset'] + $this->perPage, $this->entries), 'sortfields' => array_keys($this->fields), - ] : [] + ] ]; }