Bug 12622

Summary: Exporting report as Open Document Spreadsheet results in Perl error when report has no results
Product: Koha Reporter: Katrin Fischer <katrin.fischer>
Component: ReportsAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: gmcharlt, jonathan.druart, karamqubsi, nengard, tomascohen
Version: Main   
Hardware: All   
OS: All   
See Also: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12888
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on: 11679    
Bug Blocks:    
Attachments: Bug 12622: Fix export report as ods
Signed off patch
[PASSED QA] Bug 12622: Fix export report as ods

Description Katrin Fischer 2014-07-22 07:47:42 UTC
To test:
- Run a custom report that produces results
- Export as Open Document Spreadsheet
- Verify export worked correctly

- Run a custom report that produces no results
- Export as Open Document Spreadsheet
- Verify you see a perl error:

Can't use an undefined value as an ARRAY reference at /usr/share/koha/intranet/cgi-bin/reports/guided_reports.pl line 817.
Comment 1 Jonathan Druart 2014-07-22 10:19:40 UTC Comment hidden (obsolete)
Comment 2 Robert Higgins 2014-07-25 03:23:15 UTC Comment hidden (obsolete)
Comment 3 Katrin Fischer 2014-07-25 06:37:04 UTC
Created attachment 30074 [details] [review]
[PASSED QA] Bug 12622: Fix export report as ods

Bug 11679 introduces an ods export for reports.

It looks quite buggy:
1/ You get a Perl error if the report has no results
2/ The ods file contains 1 lines less than the total results.

Test plan:
After applying this patch, try to export a report which has no results
and verify you get an ods file with headers only.
Try to export a report which has a least 1 result and verify the
generated ods has the right number of lines.

Signed-off-by: Robert Higgins <robert.higgins@catalyst.net.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Fixes the reported problem, passes all tests and QA script.
Added the sign-off line for Robert.
Comment 4 Katrin Fischer 2014-07-25 06:38:19 UTC
Resetting Assigned to to Jonathan - as he is the patch writer. Thx for testing Robert!
Comment 5 Tomás Cohen Arazi 2014-07-29 14:49:32 UTC
Patch pushed to master.

Thanks Jonathan!
Comment 6 Galen Charlton 2014-08-26 22:41:24 UTC
Pushed to 3.16.x for inclusion in 3.16.3.
Comment 7 Katrin Fischer 2014-10-13 23:09:16 UTC
*** Bug 13010 has been marked as a duplicate of this bug. ***
Comment 8 Katrin Fischer 2014-10-13 23:09:37 UTC
*** Bug 12888 has been marked as a duplicate of this bug. ***