Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

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

Closed
robinsowell opened this issue Sep 12, 2024 · 0 comments · Fixed by #4465
Closed

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

robinsowell opened this issue Sep 12, 2024 · 0 comments · Fixed by #4465
Labels
Bug: Accepted Bug has been confirmed, is reproducible, and ready to work on.

Comments

@robinsowell
Copy link
Contributor

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.

@robinsowell robinsowell added the Bug: Accepted Bug has been confirmed, is reproducible, and ready to work on. label Sep 12, 2024
TomJaeger added a commit that referenced this issue May 14, 2025
…ra-chars

Resolved #4462 where pagination was not correct when extra characters added to pagination URI
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug: Accepted Bug has been confirmed, is reproducible, and ready to work on.
Projects
None yet
1 participant