Bug 21984: Pass param_name in pagination URL
authorNick Clemens <nick@bywatersolutions.com>
Tue, 11 Dec 2018 15:15:57 +0000 (15:15 +0000)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Thu, 20 Dec 2018 09:52:35 +0000 (09:52 +0000)
To test:
 1 - Create a report like:
    SELECT <<cat>>,<<dog>>,<<cat>> FROM items
 2 - Run the report, enter 'CATS' and 'DOGS'
 3 - Get results LIKE "CAT | DOG | CAT"
 4 - Try to go to page 2
 5 - FAIL! (last column is blank)
 6 - Apply patch
 7 - Run the repot, enter 'CATS' and 'DOGS'
 8 - Verify first page looks right
 9 - Go to page 2
10 - Results are correct!

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: “Lucas Gass” <lucas@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit f28a97034dd06b0f2b0e2e5fc56bea3878ffc717)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

reports/guided_reports.pl

index 4a0e405..24dd108 100755 (executable)
@@ -829,9 +829,13 @@ elsif ($phase eq 'Run this report'){
 
             my $totpages = int($total/$limit) + (($total % $limit) > 0 ? 1 : 0);
             my $url = "/cgi-bin/koha/reports/guided_reports.pl?reports=$report_id&amp;phase=Run%20this%20report&amp;limit=$limit";
+            if (@param_names) {
+                $url = join('&amp;param_name=', $url, map { URI::Escape::uri_escape_utf8($_) } @param_names);
+            }
             if (@sql_params) {
                 $url = join('&amp;sql_params=', $url, map { URI::Escape::uri_escape_utf8($_) } @sql_params);
             }
+
             $template->param(
                 'results' => \@rows,
                 'allresults' => \@allrows,