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

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

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

bugzilla-daemon
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: [hidden email]
          Reporter: [hidden email]
        QA Contact: [hidden email]
                CC: [hidden email]

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.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

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

bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21035

Barton Chittenden <[hidden email]> 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.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

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

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21035

Jonathan Druart <[hidden email]> 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.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

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

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21035

--- Comment #1 from Jonathan Druart <[hidden email]> ---
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.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

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

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21035

Jonathan Druart <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[hidden email]-c
                   |                            |ommunity.org
           Assignee|[hidden email]-commun |[hidden email]-c
                   |ity.org                     |ommunity.org

--
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

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

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21035

Maryse Simard <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|Needs Signoff               |Signed Off

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

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

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21035

Maryse Simard <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #76698|0                           |1
        is obsolete|                            |

--- Comment #2 from Maryse Simard <[hidden email]> ---
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 <[hidden email]>
Followed the test plan and it works.

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

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

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21035

Katrin Fischer <[hidden email]> 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.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

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

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21035

Katrin Fischer <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #76964|0                           |1
        is obsolete|                            |

--- Comment #3 from Katrin Fischer <[hidden email]> ---
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 <[hidden email]>
Followed the test plan and it works.

Signed-off-by: Katrin Fischer <[hidden email]>

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

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

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21035

Katrin Fischer <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[hidden email]

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

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

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21035

Katrin Fischer <[hidden email]> 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.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

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

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21035

Nick Clemens <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|Passed QA                   |Pushed to Master
                 CC|                            |[hidden email]

--- Comment #4 from Nick Clemens <[hidden email]> ---
Awesome work all!

Pushed to master for 18.11

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/
Reply | Threaded
Open this post in threaded view
|

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

bugzilla-daemon
In reply to this post by bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21035

Martin Renvoize <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |martin.renvoize@ptfs-europe
                   |                            |.com
             Status|Pushed to Master            |Pushed to Stable

--- Comment #5 from Martin Renvoize <[hidden email]> ---
Pushed to 18.05.x for 18.05.03

--
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[hidden email]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/