Pagerfanta icon indicating copy to clipboard operation
Pagerfanta copied to clipboard

Protection from negative result offset

Open meskis opened this issue 11 years ago • 6 comments

Issue when getCurrentPage returns 0, offset becomes -10

meskis avatar May 11 '13 21:05 meskis

When does this happen? Current page should not be less than 1.

pablodip avatar May 14 '13 11:05 pablodip

Ping.

pablodip avatar Jun 12 '13 10:06 pablodip

Sorry for delay. As far as I debugged, there is the scenario for exception: in list page, go to Nth page, then filter to have 0 results and current page becomes 0, as there are 0 results. Then method calculateOffsetForCurrentPageResults subtracts 1 from 0 ant we get negative result causing app to brake.

meskis avatar Jul 16 '13 21:07 meskis

Could you add a test case for this, please?

pablodip avatar Oct 24 '13 23:10 pablodip

Ping.

pablodip avatar Nov 08 '13 00:11 pablodip

Ping2

pablodip avatar Jan 04 '14 14:01 pablodip