[Bug 21035] New: runreport.pl prints only a newline when printing a row that has a field that contains an embedded newline.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21035 Bug ID: 21035 Summary: runreport.pl prints only a newline when printing a row that has a field that contains an embedded newline. Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Command-line Utilities Assignee: koha-bugs@lists.koha-community.org Reporter: barton@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org CC: robin@catalyst.net.nz when runrepurt.pl is run using the --format=csv or --format=tsv options, any fields which contain embedded newlines will cause the row of results to be blank, displaying only a newline. To replicate: 1) Choose two items, say barcode '123' and '456' 2) Change the public note on 123 to read Line1 Line2 (I.e. type 'Line1', then press Enter, type 'Line2' and click update). 3) Change the public note on 456 to read Public note has one and only one line. Click update. 4) Create a report with the followng query: select barcode, itemnotes from items where barcode in ( '123', '456' ) Let's say that this is report number 10. 5) run ./misc/cronjobs/runreport.pl --format=csv 10: $ perl ./misc/cronjobs/runreport.pl --format=csv 9 456,"Public note has one and only one line." The same results hold when using --format=tsv When using --format=html, both rows are displayed: $ perl ./misc/cronjobs/runreport.pl --format=html 10 <table><tr><td>123</td> <td>Line1 Line2</td></tr> <tr><td>456</td> <td>Public note has one and only one line.</td></tr> -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21035 Barton Chittenden <barton@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|enhancement |minor -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21035 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21035 --- Comment #1 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 76698 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=76698&action=edit Bug 21035: Handle new lines when running reports See https://metacpan.org/pod/Text::CSV_XS#Embedded-newlines Test plan: 1) Choose two items, say barcode '123' and '456' 2) Change the public note on 123 to read Line1 Line2 (I.e. type 'Line1', then press Enter, type 'Line2' and click update). 3) Change the public note on 456 to read Public note has one and only one line. Click update. 4) Create a report with the followng query: select barcode, itemnotes from items where barcode in ( '123', '456' ) Let's say that this is report number 10. 5) run ./misc/cronjobs/runreport.pl --format=csv REPORT_ID: => You should see both lines -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21035 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@bugs.koha-c | |ommunity.org Assignee|koha-bugs@lists.koha-commun |jonathan.druart@bugs.koha-c |ity.org |ommunity.org -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21035 Maryse Simard <maryse.simard@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21035 Maryse Simard <maryse.simard@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #76698|0 |1 is obsolete| | --- Comment #2 from Maryse Simard <maryse.simard@inlibro.com> --- Created attachment 76964 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=76964&action=edit Bug 21035: Handle new lines when running reports See https://metacpan.org/pod/Text::CSV_XS#Embedded-newlines Test plan: 1) Choose two items, say barcode '123' and '456' 2) Change the public note on 123 to read Line1 Line2 (I.e. type 'Line1', then press Enter, type 'Line2' and click update). 3) Change the public note on 456 to read Public note has one and only one line. Click update. 4) Create a report with the followng query: select barcode, itemnotes from items where barcode in ( '123', '456' ) Let's say that this is report number 10. 5) run ./misc/cronjobs/runreport.pl --format=csv REPORT_ID: => You should see both lines Signed-off-by: Maryse Simard <maryse.simard@inlibro.com> Followed the test plan and it works. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21035 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Trivial patch Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21035 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #76964|0 |1 is obsolete| | --- Comment #3 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 77425 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=77425&action=edit Bug 21035: Handle new lines when running reports See https://metacpan.org/pod/Text::CSV_XS#Embedded-newlines Test plan: 1) Choose two items, say barcode '123' and '456' 2) Change the public note on 123 to read Line1 Line2 (I.e. type 'Line1', then press Enter, type 'Line2' and click update). 3) Change the public note on 456 to read Public note has one and only one line. Click update. 4) Create a report with the followng query: select barcode, itemnotes from items where barcode in ( '123', '456' ) Let's say that this is report number 10. 5) run ./misc/cronjobs/runreport.pl --format=csv REPORT_ID: => You should see both lines Signed-off-by: Maryse Simard <maryse.simard@inlibro.com> Followed the test plan and it works. Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21035 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |katrin.fischer@bsz-bw.de -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21035 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|runreport.pl prints only a |runreport.pl prints only a |newline when printing a row |newline when printing a row |that has a field that |that has a field that |contains an embedded |contains an embedded |newline. |newline -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21035 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master CC| |nick@bywatersolutions.com --- Comment #4 from Nick Clemens <nick@bywatersolutions.com> --- Awesome work all! Pushed to master for 18.11 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21035 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |martin.renvoize@ptfs-europe | |.com Status|Pushed to Master |Pushed to Stable --- Comment #5 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Pushed to 18.05.x for 18.05.03 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21035 Fridolin SOMERS <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m Status|Pushed to Stable |RESOLVED Resolution|--- |FIXED --- Comment #6 from Fridolin SOMERS <fridolin.somers@biblibre.com> --- Pushed to 17.11.x for 17.11.10 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org