Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug in pagination does not apply where clause #341

Closed
jpmateo022 opened this issue Jan 27, 2021 · 1 comment · Fixed by #343
Closed

Bug in pagination does not apply where clause #341

jpmateo022 opened this issue Jan 27, 2021 · 1 comment · Fixed by #343
Labels
bug An existing feature is not working as intended easy These issues are geared for people who have not yet contributed to this project yet

Comments

@jpmateo022
Copy link

Hi,

It seems the pagination doesn't apply the where clause wherein it returns the total items in the database.

The total field value should only be 9.

image

The validation I made via manual SQL query
image

The total items I have in the database without filtering.
image

@josephmancuso josephmancuso added bug An existing feature is not working as intended easy These issues are geared for people who have not yet contributed to this project yet labels Jan 27, 2021
@josephmancuso
Copy link
Member

Yup issue is right here on line 1322:

total = self.new().count()
paginator = LengthAwarePaginator(result, per_page, page, total)
return paginator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An existing feature is not working as intended easy These issues are geared for people who have not yet contributed to this project yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants