Skip to content

Moderations pagination never shows the final page of results #1433

Closed
@caius

Description

Steps to reproduce

  1. Empty your local moderation log
  2. Insert 51 - 99 moderation records
  3. Load http://localhost:3000/moderations

Expected result

Latest 50 moderation entries listed, with "Page 2" link at bottom of page to view remaining ones

Actual result

Latest 50 moderation entries listed, but no link to page 2 appears.

Adding page=2 to the params results in a routing error "page out of bounds".

Notes

This is reproducible with any number of pages too, so it's a permanent off-by-one error in the logic. eg, having 149 moderation entries only results in being able to view 149-99, 99-49. The final 49 entries that should be on page 3 are invisible.

I suspect our maths is wrong in the ModerationsController#index action and we're working out the max page number to be 1 less than it should be, failing to account for the final (incomplete) page of entries.

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions