Description
Marcel de Rooy
2017-11-07 15:02:02 UTC
Created attachment 69116 [details] [review] Bug 19585: Inventory: Allow additional separators in a barcode file This patch makes \n, \r, |, comma and semicolon all valid separators between barcodes passed to inventory. An additional grep removes empty barcodes. Test plan: Upload a barcode file that contains various allowed separators. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Created attachment 69117 [details] [review] Bug 19585: Inventory: Allow additional separators in a barcode file This patch makes \n, \r, |, comma and semicolon all valid separators between barcodes passed to inventory. An additional grep removes empty barcodes. (Note: The grep looks for at least one non-whitespace character. We could be more specific, but this allows for more flexibility like testing with alphanumeric barcodes etc.) Test plan: Upload a barcode file that contains various allowed separators. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Created attachment 69118 [details] [review] Bug 19585: Inventory: Allow additional separators in a barcode file This patch makes \n, \r, |, comma and semicolon all valid separators between barcodes passed to inventory. An additional grep removes empty barcodes. (Note: The grep looks for at least one non-whitespace character. We could be more specific, but this allows for more flexibility like testing with alphanumeric barcodes etc.) Test plan: Upload a barcode file that contains various allowed separators. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Created attachment 69154 [details] [review] Bug 19585: Inventory: Allow additional separators in a barcode file This patch makes \n, \r, |, comma, semicolon and hyphen ('-') all valid separators between barcodes passed to inventory. An additional grep removes empty barcodes. (Note: The grep looks for at least one non-whitespace character. We could be more specific, but this allows for more flexibility like testing with alphanumeric barcodes etc.) Test plan: Upload a barcode file that contains various allowed separators. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Decided to add the hyphen ('-') too as a separator. We need him also. Created attachment 70535 [details] [review] Bug 19585: Inventory: Allow additional separators in a barcode file This patch makes \n, \r, |, comma, semicolon and hyphen ('-') all valid separators between barcodes passed to inventory. An additional grep removes empty barcodes. (Note: The grep looks for at least one non-whitespace character. We could be more specific, but this allows for more flexibility like testing with alphanumeric barcodes etc.) Test plan: Upload a barcode file that contains various allowed separators. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Jenny Way <jwayway@hotmail.com> Created attachment 70625 [details] [review] Bug 19585: Inventory: Allow additional separators in a barcode file This patch makes \n, \r, |, comma, semicolon and hyphen ('-') all valid separators between barcodes passed to inventory. An additional grep removes empty barcodes. (Note: The grep looks for at least one non-whitespace character. We could be more specific, but this allows for more flexibility like testing with alphanumeric barcodes etc.) Test plan: Upload a barcode file that contains various allowed separators. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Jenny Way <jwayway@hotmail.com> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Pushed to master for 18.05, thanks to everybody involved! Awesome work all! Enhancement, not backported for 17.11. And if a library has barcodes with hyphens (-)? (In reply to Frédéric Demians from comment #10) > And if a library has barcodes with hyphens (-)? Yeah, we'd better move these chars in a pref ? When playing with this issue, I was comparing inventory tool with Batch item modification tool. Both tools accept as input a barcodes file. Barcodes with hyphen are OK in Batch item modification. This regex is used to split file lines: /[\r\n]/ Barcodes with hyphen are not OK in Inventory tool. This regex is used: /[\n\r,;|-]/ Wouldn't it make sense to have the same splitting logic in both places? I agree, especially since hyphen and other characters are not as unlikey as one might think. But we should move this to a new bug as this has already been pushed. (In reply to Frédéric Demians from comment #12) > When playing with this issue, I was comparing inventory tool with Batch item > modification tool. Both tools accept as input a barcodes file. > > Barcodes with hyphen are OK in Batch item modification. This regex is used > to split file lines: > > /[\r\n]/ > > Barcodes with hyphen are not OK in Inventory tool. This regex is used: > > /[\n\r,;|-]/ > > Wouldn't it make sense to have the same splitting logic in both places? See bug 22996. |