Comment 2 for bug 1813954

Revision history for this message
Josh Stompro (u-launchpad-stompro-org) wrote :

It looks like the code that processes the file of barcodes is at
https://git.evergreen-ils.org/?p=Evergreen.git;a=blob;f=Open-ILS/web/js/ui/default/staff/cat/item/app.js;hb=bb6495dd8e2e7a8c8cee4577799b14b061261f21#l285

I wonder if the "if (!line) return;" in the loop function is allowing blank barcodes through? I added some logging and that does seem to be the problem.

Array(18) [ "50723000443123", "50723010107874", "", "50723010116834", "50723000013827", "50723010092811", "50723010155386", "", "50723010108526", "50723010005771", … ]

Blank barcodes are getting through.

Moving the "if (!line) return;" to below the regex seems to solve this issue for me. But I don't get why. What is that regex doing to an empty string that fixes the logical not check?

Josh