From 054fa0552f1362decbff67abd2d462384700622e Mon Sep 17 00:00:00 2001 From: Alex Orosciuc Date: Tue, 8 Jul 2025 14:50:50 +0100 Subject: [PATCH] Run a more robust count query that supports "group by" Fixes https://github.com/wintercms/winter/issues/454 --- modules/backend/widgets/Lists.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/backend/widgets/Lists.php b/modules/backend/widgets/Lists.php index 2b3aa59b80..832e7a40e3 100644 --- a/modules/backend/widgets/Lists.php +++ b/modules/backend/widgets/Lists.php @@ -785,7 +785,7 @@ protected function getCurrentPageNumber($query) $currentPageNumber = intval($currentPageNumber); if ($currentPageNumber > 1) { - $count = $query->count(); + $count = $query->toBase()->getCountForPagination(); // If the current page number is higher than the amount of available pages, go to the last available page if ($count <= (($currentPageNumber - 1) * $this->recordsPerPage)) {