Page 1 of 0

Empty lists of tickets currently report that they are "Page 1 of 0"
For some reason, this annoys me.

This may not be the best fix, but it does the trick, turning them into Page 1
of 1.

Nicholas Clark

— html/Elements/TicketList~ Tue Dec 19 20:12:17 2006
+++ html/Elements/TicketList Wed May 16 15:21:52 2007
@@ -75,7 +75,9 @@
% if (($TotalFound % $Rows) == 0) {
% $oddRows = 0;
% } else { $oddRows = 1; }
-<&|/l, $Page, int($TotalFound/$Rows)+$oddRows&>Page [_1] of [_2]</&>
+% my $pages = int($TotalFound/$Rows)+$oddRows;
+% $pages = 1 if $pages < 1;
+<&|/l, $Page, $pages &>Page [_1] of [_2]</&>

<%perl>
my $prev = $m->comp(

Empty lists of tickets currently report that they are "Page 1 of 0"
For some reason, this annoys me.

Wait until you do a search as a user who can’t see all the tickets, and
the search returns multiple pages you can’t see. If you get annoyed by
page 1 of 0, BP should build a fallout shelter before you see that… :slight_smile:

Good Fix.
M

Thanks. Applied for 3.6.4On May 16, 2007, at 11:26 AM, Nicholas Clark wrote:

— html/Elements/TicketList~ Tue Dec 19 20:12:17 2006
+++ html/Elements/TicketList Wed May 16 15:21:52 2007
@@ -75,7 +75,9 @@
% if (($TotalFound % $Rows) == 0) {
% $oddRows = 0;
% } else { $oddRows = 1; }
-<&|/l, $Page, int($TotalFound/$Rows)+$oddRows&>Page [_1] of [_2]</&>
+% my $pages = int($TotalFound/$Rows)+$oddRows;
+% $pages = 1 if $pages < 1;
+<&|/l, $Page, $pages &>Page [_1] of [_2]</&>

PGP.sig (186 Bytes)

Thanks. Applied for 3.6.4

I couldn’t spot any other code that seemed capable of generating Page 1 of 0.
Are there others? Or do all end up here:> On May 16, 2007, at 11:26 AM, Nicholas Clark wrote:

+++ html/Elements/TicketList Wed May 16 15:21:52 2007

Nicholas Clark

Thanks. Applied for 3.6.4

I couldn’t spot any other code that seemed capable of generating
Page 1 of 0.
Are there others? Or do all end up here:

+++ html/Elements/TicketList Wed May 16 15:21:52 2007

I sure hope so :slight_smile:

PGP.sig (186 Bytes)

Thanks. Applied for 3.6.4

I couldn’t spot any other code that seemed capable of generating
Page 1 of 0.
Are there others? Or do all end up here:

+++ html/Elements/TicketList Wed May 16 15:21:52 2007

I sure hope so :slight_smile:

Taht may become untrue in 3.7 as we have more generic “list” widgets.
But let’s see what happens when we smerge.

PGP.sig (186 Bytes)