Skip to content

Pagination not working as expected #641

@podarcis

Description

@podarcis

API Platform version(s) affected:

  • api-platform/api-platform v4.1.0 (and main)
  • @api-platform/admin v4.0.6

Description

With a fresh installation (following https://api-platform.com/docs/symfony/) that comes with a demo resource "Greeting", the pagination does not work as expected.

Having 6 items in the database and the pagination control with its pagesize-dropdown having 5 items-per-page, the listing incorrectly shows those full 6 items, and a click on page 2 results in two requests and still being on page 1.

Having 31 items in the database (while pagination control still showing 5 items-per-page), the listing shows 30 entries and a click on page 2 shows the 31th.

Page 1:
Image

Page 2:
Image

So it seems that the effective page-size is always 30 items, and the admin pagesize and pagination info is incorrect.

I found a similar issue #369 of 2021. However, I'm describing the behavior of an unmodified installation of API Platform with its demo resource already behaving incorrectly.

How to reproduce

  • Install API Platform via template v4.1.0 (and/or use admin v4.0.6)
  • Open admin interface in browser.
  • Add 11 greeting entries -> Notice all 11 items to be shown, while pagesize says 10 items-per-page. Click page 2 and nothing happens.
  • Add 31 greeting entries -> Notice 30 items to be shown and click on page 2 shows the 31th.

Possible Solution

Unknown

Additional Context

n/a

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions