cphalcon icon indicating copy to clipboard operation
cphalcon copied to clipboard

Paginator doesn't work correctly

Open ghost opened this issue 14 years ago • 6 comments

I have 123 results. Sorted 9 per page. It's 14 pages with 6 results in last page. Your pagination $page->last is page number 13 and possible navigate to 14 page with $page->next. Checked in windows and linux os.

ghost avatar Nov 20 '12 18:11 ghost

Hi webrent, can you post a full test to check the problem, thanks

ghost avatar Nov 20 '12 20:11 ghost

On the penultimate page, the next atribute don't holds last page but the penultimate page. I'm using NativeArray adapter and Phalcon 0.7.0 BETA 1

mruz avatar Dec 03 '12 19:12 mruz

Hi, I added the following test: https://github.com/phalcon/cphalcon/blob/0.7.0/unit-tests/PaginatorTest.php#L337 and it is passing on Travis (https://travis-ci.org/phalcon/cphalcon/builds/3498632)

Could you please tell me how many elements has the array and how many results are shown per page?

ghost avatar Dec 04 '12 18:12 ghost

Eg for 4 elements in the array and 1 item per page (should be 4 pages). On the penultimate page (3) next atribute holds value 3(float), but the last atribute holds value 4 (intiger). In the model adapter is the same.

mruz avatar Dec 04 '12 18:12 mruz

Still is problem with next

Riu avatar Feb 05 '13 10:02 Riu

This problem still exists. If I have 30 items, with a limit of 25/page, the next is shown as 1, not 2.

alfredbaudisch avatar Mar 30 '13 16:03 alfredbaudisch