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

Bug #1766982 reported by Andrea Neiman on 2018-04-25
30
This bug affects 6 people
Affects Status Importance Assigned to Milestone
Evergreen
Undecided
Unassigned
3.1
Undecided
Unassigned
3.2
Undecided
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.

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
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)
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.

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) on 2018-05-11
tags: added: pullrequest
Garry Collum (gcollum) on 2018-05-17
Changed in evergreen:
status: Confirmed → In Progress
Garry Collum (gcollum) on 2018-05-21
Changed in evergreen:
assignee: Garry Collum (gcollum) → nobody
Garry Collum (gcollum) on 2018-05-27
Changed in evergreen:
status: In Progress → Confirmed

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) on 2019-04-16
Changed in evergreen:
milestone: none → 3.3.1
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers