Bug 18734 - Internal server error in cash_register_stats.pl when exporting to file
Summary: Internal server error in cash_register_stats.pl when exporting to file
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Reports (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Nick Clemens
QA Contact: Testopia
URL:
Keywords:
Depends on: 6934
Blocks: 18694
  Show dependency treegraph
 
Reported: 2017-06-06 09:13 UTC by Marc Véron
Modified: 2018-12-03 20:05 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 18734 - Internal server error in cash_register_stats.pl when exporting to file (2.47 KB, patch)
2017-06-09 14:19 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 18734 - Internal server error in cash_register_stats.pl when exporting to file (2.60 KB, patch)
2017-06-09 14:44 UTC, Marc Véron
Details | Diff | Splinter Review
Bug 18734 - Internal server error in cash_register_stats.pl when exporting to file (2.60 KB, patch)
2017-06-09 14:58 UTC, Marc Véron
Details | Diff | Splinter Review
Bug 18734 - Internal server error in cash_register_stats.pl when exporting to file (2.67 KB, patch)
2017-06-12 17:32 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Marc Véron 2017-06-06 09:13:03 UTC
To reproduce:

- Go to Home > Reports > Cash register statistics
- Select a date range
- Output to screen in browser: Displays OK
- Output to a file: Internal Server Error

Plack error log says:

CGI::param called in list context from package CGI::Compile::ROOT::home_marc_koha_reports_cash_register_stats_2epl line 64, this can lead to vulnerabilities. See the warning in "Fetching the value or values of a single named parameter" at /usr/share/perl5/CGI.pm line 436.
CGI::param called in list context from package CGI::Compile::ROOT::home_marc_koha_reports_cash_register_stats_2epl line 66, this can lead to vulnerabilities. See the warning in "Fetching the value or values of a single named parameter" at /usr/share/perl5/CGI.pm line 436.
exited nonzero: 1 at /home/marc/koha/reports/cash_register_stats.pl line 201.
Comment 1 Marc Véron 2017-06-07 16:46:52 UTC
The internal server error can be fixed by changing line 174 from exit(1); to exit(0);

But then an new issue appears: The export has an empty line above the header line, and the header line is mixed with and without double quotes:

mfirstname;card number;firstname;branchname;date;accounttype;amount;title;barcode;"itype"
Comment 2 Nick Clemens 2017-06-09 14:19:21 UTC
Created attachment 64137 [details] [review]
Bug 18734 - Internal server error in cash_register_stats.pl when exporting to file

To test:
Output cash reigster stats report to file
Internal server error
Apply patch
Export to file
File is generated and correctly formed
Comment 3 Marc Véron 2017-06-09 14:44:47 UTC
Created attachment 64142 [details] [review]
Bug 18734 - Internal server error in cash_register_stats.pl when exporting to file

To test:
Output cash reigster stats report to file
Internal server error
Apply patch
Export to file
File is generated and correctly formed

Signed-off-by: Marc Véron <veron@veron.ch>
Comment 4 Marc Véron 2017-06-09 14:58:01 UTC
Created attachment 64146 [details] [review]
Bug 18734 - Internal server error in cash_register_stats.pl when exporting to file

To test:
Output cash reigster stats report to file
Internal server error
Apply patch
Export to file
File is generated and correctly formed

Signed-off-by: Marc Véron <veron@veron.ch>
Comment 5 Jonathan Druart 2017-06-12 17:32:48 UTC
Created attachment 64230 [details] [review]
Bug 18734 - Internal server error in cash_register_stats.pl when exporting to file

To test:
Output cash reigster stats report to file
Internal server error
Apply patch
Export to file
File is generated and correctly formed

Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 6 Jonathan Druart 2017-06-12 20:59:00 UTC
Pushed to master for 17.11, thanks to everybody involved!
Comment 7 Fridolin Somers 2017-06-13 07:16:53 UTC
Pushed to 17.05.x, will be in 17.05.01
Comment 8 Katrin Fischer 2017-06-13 20:41:57 UTC
This patch has been pushed to 16.11.x and will be in 16.11.09.
Comment 9 Mason James 2017-09-19 23:21:32 UTC
Patchset has conflicts, skipping for 16.05.x
Comment 10 Mason James 2017-09-19 23:28:27 UTC
(In reply to Mason James from comment #9)
> Patchset has conflicts, skipping for 16.05.x

depends on BZ 6934