jarektkaczyk / eloquence-base

base for the Eloquence extensions + Searchable
https://softonsofa.com
MIT License
77 stars 69 forks source link

Error with search and pagination when using group by #27

Open ghost opened 4 years ago

ghost commented 4 years ago

Recent change introduced in Laravel 7.10.0, and merged from https://github.com/laravel/framework/pull/32624 broke search and pagination functionality when Eloquence is used with group by queries.

Problem with both is that base version of runPaginationCountQuery is changed, and now uses subquery to get count for pagination. This produces multiple rows of aggregates, and the pagination total is returned from first row only.

This can be solved by replacing/removing the method in Sofa\Eloquence\Query\Builder, but then search query gets wrapped in subquery and times out for me, so I couldn't get any further in investigating it.

C10ne commented 4 years ago

Any info when Laravel 7.10.+ version will be supported?