Skip to content

When using listExtendQuery with groupby, paginate seems not work #454

@fanti1

Description

@fanti1

Winter CMS Build

Other (please specify below)

PHP Version

7.4

Database engine

MySQL/MariaDB

Plugins installed

No response

Issue description

Hello everyone.
I have a model listing, where I need to override the standard querie, using a groupBy that returns the desired results, according to the business rule. The values ​​that appear as "totals" in the pagination are correct.

The problem is, when doing this:
public function listExtendQuery($query)
{
$query->groupBy('column');
}

And when trying to move from one page to another, it just doesn't load. I get stuck on the first page.
See: the pagination widget is loaded, but it doesn't work when I click next page...

Does anyone have any ideas?

Steps to replicate

• Use any model with some data
• In the controller of above's model, use the listExtendQuery to override default querie using: $query->groupBy('some_column')
• Try to click in the next step indicator

Workaround

Nothing yet.

Metadata

Metadata

Assignees

Labels

needs reviewIssues/PRs that require a review from a maintainerstaleIssues/PRs that have had no activity and may be archived
No fields configured for Unconfirmed Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions