processwire-issues icon indicating copy to clipboard operation
processwire-issues copied to clipboard

ListerPro shouldn't show pagination when limit=0

Open jlahijani opened this issue 1 year ago • 2 comments

I have a ListerPro. If I set the limit to 0, it shows pagination (incorrect). If I set it to a high number that exceeds the amount of listings I have (ex: 9999), it doesn't show pagination (correct).

Short video demonstration: https://www.youtube.com/watch?v=Ozzylou2Fcs

Using latest versions of everything.

jlahijani avatar Jun 03 '24 17:06 jlahijani

@jlahijani Thanks I've attempted a fix, does it also fix there? The only thing is Lister can't support unlimited results, as pagination would be necessary for larger result sets. I don't think it could ever display 9999 results for example. So a setting of 0 is likely to break Lister once it gets past several hundred results, or fewer, depending on what fields are being rendered in the table. But maybe it's safe to assume most know that. Though having a specific value like 999 does seem like at least the user knows what they are getting into more than a value of 0. So I'm not entirely sure we should support 0 here, but we'll give it a try.

ryancramerdesign avatar Jun 07 '24 16:06 ryancramerdesign

Hi Ryan,

That change didn't work. I looked into it further based on what you did. It seems that line of code you modified never even gets run if limit is 0, meaning line 994 } else if(!is_null($limit)) { is never true to begin with.

jlahijani avatar Jun 07 '24 17:06 jlahijani

@jlahijani Specifying limit=0 seems to work for me, in terms of showing all the results on 1 screen, but it was still showing unnecessary pagination. I've updated it so that it does not show the pagination.

ryancramerdesign avatar Dec 23 '24 16:12 ryancramerdesign