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>
Created attachment 76698 [details] [review] 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
Created attachment 76964 [details] [review] 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.
Created attachment 77425 [details] [review] 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>
Awesome work all! Pushed to master for 18.11
Pushed to 18.05.x for 18.05.03
Pushed to 17.11.x for 17.11.10