From 7f8176a2424fcc736e96b5f15f0e4611090539d8 Mon Sep 17 00:00:00 2001 From: Kyle Hall Date: Mon, 1 Aug 2022 10:47:04 -0400 Subject: [PATCH] Bug 31276: Report results are limited to 999,999 no matter the actual number of results In Koha, any report that uses C4::Reports::Guided will be limited to 999,999 rows. This is causing problems for larger libraries where some reports may have over a million results. Test Plan: 1) Create a report "SELECT * FROM borrowers" and run it, note the number of results 2) Apply this patch 3) Add the line `3` within the block of your koha-conf.xml 4) Restart all the things! 5) Run the report, download the results as a CSV 6) Note your CSV only has 4 lines, the header and 3 patrons --- C4/Reports/Guided.pm | 2 +- debian/templates/koha-conf-site.xml.in | 4 ++++ etc/koha-conf.xml | 4 ++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/C4/Reports/Guided.pm b/C4/Reports/Guided.pm index 2d29b2138e7..b6d58955c30 100644 --- a/C4/Reports/Guided.pm +++ b/C4/Reports/Guided.pm @@ -559,7 +559,7 @@ sub execute_query { my $params = shift; my $sql = $params->{sql}; my $offset = $params->{offset} || 0; - my $limit = $params->{limit} || 999999; + my $limit = $params->{limit} || C4::Context->config('report_results_limit') || 999999; my $sql_params = defined $params->{sql_params} ? $params->{sql_params} : []; my $report_id = $params->{report_id}; diff --git a/debian/templates/koha-conf-site.xml.in b/debian/templates/koha-conf-site.xml.in index 2e66535c005..29b378bc70d 100644 --- a/debian/templates/koha-conf-site.xml.in +++ b/debian/templates/koha-conf-site.xml.in @@ -304,6 +304,10 @@ __END_SRU_PUBLICSERVER__ __API_SECRET__ + + CHANGEME + +