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: X-Pagination-Total-Count is always 0 #20055

Closed
Psyopus opened this issue Oct 27, 2023 · 3 comments
Closed

Bug: X-Pagination-Total-Count is always 0 #20055

Psyopus opened this issue Oct 27, 2023 · 3 comments
Labels
Milestone

Comments

@Psyopus
Copy link

Psyopus commented Oct 27, 2023

Hi,

After this commit #3014fa2 X-Pagination-Total-Count header is always 0. So it breaks pagination. I believe it happens because pagination headers are set before real totalCount calculated.

if (($pagination = $dataProvider->getPagination()) !== false) {
       $this->addPaginationHeaders($pagination);
}

What steps will reproduce the problem?

Any /index GET queries returns X-Pagination-Total-Count=0

What is the expected result?

Total Count of models

What do you get instead?

0

@microinginer
Copy link
Contributor

some problem

@schmunk42
Copy link
Contributor

Should be covered by a new test also.

@rideau-nostalgia
Copy link

Looks like it was caused by this commit:
3014fa2

Pagination headers are now set before prepareModels() is called, which is the trigger to calculate the total count

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants