From de1c83f8bb52af4ed785e1476a493910ae9f6783 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Tue, 24 May 2011 15:25:41 -0400 Subject: [PATCH] bug 6409: fix pagination of SQL report output when parameters are used Fixes bug where paging through output of an SQL report that includes one or more parameters fails by asking you for the parameter values and again and sending you back to the first page of results. Signed-off-by: Galen Charlton Signed-off-by: Nicole C. Engard Signed-off-by: Chris Cormack (cherry picked from commit 577ce72e91dfafda270deb37d20c4ef1d573d493) Signed-off-by: Chris Nighswonger --- reports/guided_reports.pl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/reports/guided_reports.pl b/reports/guided_reports.pl index b939ab8945..da18feb949 100755 --- a/reports/guided_reports.pl +++ b/reports/guided_reports.pl @@ -21,6 +21,7 @@ use strict; #use warnings; FIXME - Bug 2505 use CGI; use Text::CSV; +use URI::Escape; use C4::Reports::Guided; use C4::Auth; use C4::Output; @@ -501,6 +502,9 @@ 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&phase=Run%20this%20report"; + if (@sql_params) { + $url = join('&sql_params=', $url, map { URI::Escape::uri_escape($_) } @sql_params); + } $template->param( 'results' => \@rows, 'sql' => $sql, -- 2.39.5