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

Paginator calculating last_page wrong when using soft deletes #605

Closed
cercos opened this issue Mar 1, 2022 · 2 comments · Fixed by #606
Closed

Paginator calculating last_page wrong when using soft deletes #605

cercos opened this issue Mar 1, 2022 · 2 comments · Fixed by #606
Labels
bug An existing feature is not working as intended

Comments

@cercos
Copy link

cercos commented Mar 1, 2022

Describe the bug

The paginator gives the wrong last_page count when using soft deletes. If you had 10 database entries with a per_page of 5, when you delete 6 entries, the last_page should be back at 1 but it stays at 2.

Expected behaviour

Not include soft deleted rows in last_page count

Steps to reproduce the bug

No response

Screenshots

No response

OS

Linux

OS version

KDE 5.24.1

Browser

No response

Masonite Version

4.6.1

Anything else ?

No response

@cercos cercos added the bug An existing feature is not working as intended label Mar 1, 2022
@josephmancuso
Copy link
Member

This should be an easy fix. When we perform a new query to get the totals we create a new query builder. On this new query builder must not be passing the global scopes

@josephmancuso josephmancuso transferred this issue from MasoniteFramework/masonite Mar 4, 2022
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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants