webclient: csv downloads certain blank grid values as 'null'

Bug #1766982 reported by Andrea Neiman
30
This bug affects 6 people
Affects Status Importance Assigned to Milestone
Evergreen
Fix Released
Medium
Unassigned
3.1
Fix Released
Medium
Unassigned
3.2
Fix Released
Medium
Unassigned

Bug Description

Web client -- 3.0.0, 3.0.7 (EOLI test servers), and 3.1rc (MassLNC test server).

Spinning this off from bug 1766640 as I think it is its own issue.

In both the Item Status grid and the Holds Pull List grid, an Author field that shows as blank in the grid (i.e. a DVD or the like) will show 'null' in the downloaded CSV file. In Item Status, I also note that a blank Alert Message will similarly download as 'null' (less of an issue, as 3.1's Copy Alerts Matrix will be replacing Alert Messages, but perhaps a clue).

I ran this on a few test systems as noted above and I see the same issue in all three.

Revision history for this message
Scott Thomas (scott-thomas-9) wrote :

We are seeing this in PaILS. It is a problem because several of our libraries use the CSV output from Item Status to produce pocket labels.

Changed in evergreen:
status: New → Confirmed
Revision history for this message
Garry Collum (gcollum) wrote :

There's a function in grid.js that prepares text to be downloaded as CSV checking for quotes, commas, etc. Would a line that searches case-insensitively for fields that only contain the word 'null' and replaces the string with '' be an acceptable solution? Would there ever be case where either data is legitimately the word 'null', or that null values would be needed in any CSV file?

Changed in evergreen:
assignee: nobody → Garry Collum (gcollum)
Revision history for this message
Mike Rylander (mrylander) wrote :

Well, there's no way to represent null in CSV, so an empty string is the best we can do. The property should be tested for null-ness, though, as there's no reason we couldn't have a legitimate string containing the word "null". The function you mention is the place for the check, and one for "undefined" might not hurt, too.

Revision history for this message
Garry Collum (gcollum) wrote :

Thanks Mike for your comment. I have attached a proposed solution that checks for both null and undefined values. It can also be found at https://github.com/gcollum/Evergreen/tree/LP1766982/

Garry Collum (gcollum)
tags: added: pullrequest
Garry Collum (gcollum)
Changed in evergreen:
status: Confirmed → In Progress
Revision history for this message
Garry Collum (gcollum) wrote :
Garry Collum (gcollum)
Changed in evergreen:
assignee: Garry Collum (gcollum) → nobody
Garry Collum (gcollum)
Changed in evergreen:
status: In Progress → Confirmed
Revision history for this message
Josh Stompro (u-launchpad-stompro-org) wrote :

This worked as described for me. Before fix I see 'null' in the pull list csv extract when there is no author, after fix I see just a blank string when there is no author.

Signoff branch at: user/stompro/LP1766982_signoff

https://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/stompro/LP1766982_signoff

Josh

tags: added: signedoff
Michele Morgan (mmorgan)
Changed in evergreen:
milestone: none → 3.3.1
Changed in evergreen:
milestone: 3.3.1 → 3.3.2
Changed in evergreen:
milestone: 3.3.2 → 3.3.3
Revision history for this message
Galen Charlton (gmc) wrote :

Pushed to master, rel_3_3, rel_3_2, and rel_3_1. Thanks, Garry and Josh!

Changed in evergreen:
importance: Undecided → Medium
status: Confirmed → Fix Committed
Changed in evergreen:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.