[Koha-bugs] [Bug 21035] New: runreport.pl prints only a newline when printing a row that has a field that contains an embedded newline.

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Tue Jul 3 23:21:49 CEST 2018


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 at lists.koha-community.org
          Reporter: barton at bywatersolutions.com
        QA Contact: testopia at bugs.koha-community.org
                CC: robin at 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.


More information about the Koha-bugs mailing list