processwire / processwire-issues

ProcessWire issue reports.
44 stars 2 forks source link

ListerPro shouldn't show pagination when limit=0 #1934

Open jlahijani opened 1 month ago

jlahijani commented 1 month ago

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.

ryancramerdesign commented 1 month ago

@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.

jlahijani commented 1 month ago

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.