Skip to content

Issue with Pagination library and offset not being an integer. #4462

Description

@robinsowell

So the larger issue is in the pagination library and $this->offset not being an integer. To see the problem, put this on a template:

{exp:channel:entries orderby="date" sort="desc" limit="5" paginate="bottom"}
    <h2>{title}</h2>

    {paginate}
        <p>Page {current_page} of {total_pages} pages {pagination_links}</p>
    {/paginate}
{/exp:channel:entries}

Open page with a url like: https://75gen:8890/about/page/P2a

Warning
A non-numeric value encountered

ee/legacy/libraries/Pagination.php, line 585
    Severity: E_WARNING

I can easily 'fix' it by casting to integer around 577

$this->offset = ($this->offset == '' or ($this->per_page > 1 and $this->offset == 1)) ? 0 : (int) $this->offset;

But I don't think that's a proper fix. I think we need to be sure the Px is a proper pagination format, and we're being too loose on the match. Hence this is not a pr, but a report.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bug: AcceptedBug has been confirmed, is reproducible, and ready to work on.

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions