Bug 26175 - Remove warn if undefined barcode in misc/export_records.pl
Summary: Remove warn if undefined barcode in misc/export_records.pl
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Command-line Utilities (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Fridolin Somers
QA Contact: Testopia
URL:
Keywords:
Depends on: 16935
Blocks:
  Show dependency treegraph
 
Reported: 2020-08-07 08:58 UTC by Fridolin Somers
Modified: 2021-06-14 21:31 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
20.11.00, 20.05.04
Circulation function:


Attachments
Bug 26175: Remove warn if undefined barcode in misc/export_records.pl (1.30 KB, patch)
2020-08-07 09:09 UTC, Fridolin Somers
Details | Diff | Splinter Review
Bug 26175: Remove warn if undefined barcode in misc/export_records.pl (1.35 KB, patch)
2020-08-11 12:12 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 26175: Remove warn if undefined barcode in misc/export_records.pl (1.42 KB, patch)
2020-08-13 14:13 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 26175: (QA follow-up) Add tests for previous cashups (3.25 KB, patch)
2020-10-15 13:15 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Fridolin Somers 2020-08-07 08:58:09 UTC
When using misc/export_records.pl --deleted_barcodes if barcode is NULL you get warn :
Use of uninitialized value in say at /home/koha/src/misc/export_records.pl

Also exporting barcode if empty string makes no sense.
Comment 1 Fridolin Somers 2020-08-07 09:09:47 UTC
Created attachment 107947 [details] [review]
Bug 26175: Remove warn if undefined barcode in misc/export_records.pl

When using misc/export_records.pl --deleted_barcodes if barcode is NULL you get warn :
Use of uninitialized value in say at /home/koha/src/misc/export_records.pl

Also exporting barcode if empty string makes no sense.

Test plan :
1) Delete an item with barcode = NULL
2) Run : misc/export_records.pl --date=`date +%d/%m/%Y` --deleted_barcodes --filename=/tmp/deleted_barcodes
3) Check you se no warn "Use of uninitialized value in say ..."
4) Delete an item with barcode = ''
5) Run 2)
6) Check there is no empty line in /tmp/deleted_barcodes
Comment 2 Owen Leonard 2020-08-11 12:12:34 UTC
Created attachment 108054 [details] [review]
Bug 26175: Remove warn if undefined barcode in misc/export_records.pl

When using misc/export_records.pl --deleted_barcodes if barcode is NULL you get warn :
Use of uninitialized value in say at /home/koha/src/misc/export_records.pl

Also exporting barcode if empty string makes no sense.

Test plan :
1) Delete an item with barcode = NULL
2) Run : misc/export_records.pl --date=`date +%d/%m/%Y` --deleted_barcodes --filename=/tmp/deleted_barcodes
3) Check you se no warn "Use of uninitialized value in say ..."
4) Delete an item with barcode = ''
5) Run 2)
6) Check there is no empty line in /tmp/deleted_barcodes

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 3 Martin Renvoize (ashimema) 2020-08-13 14:13:09 UTC
Created attachment 108190 [details] [review]
Bug 26175: Remove warn if undefined barcode in misc/export_records.pl

When using misc/export_records.pl --deleted_barcodes if barcode is NULL you get warn :
Use of uninitialized value in say at /home/koha/src/misc/export_records.pl

Also exporting barcode if empty string makes no sense.

Test plan :
1) Delete an item with barcode = NULL
2) Run : misc/export_records.pl --date=`date +%d/%m/%Y` --deleted_barcodes --filename=/tmp/deleted_barcodes
3) Check you se no warn "Use of uninitialized value in say ..."
4) Delete an item with barcode = ''
5) Run 2)
6) Check there is no empty line in /tmp/deleted_barcodes

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 4 Martin Renvoize (ashimema) 2020-08-13 14:13:34 UTC
Logically makes sense and works as expected..

Passing QA
Comment 5 Jonathan Druart 2020-08-14 10:52:19 UTC
How is this --deleted_barcodes flag used?

I don't understand why it is in this script.

Why don't we display an empty line instead?
Imagine someone using it to know the number of deleted records (wc -l).
Comment 6 Jonathan Druart 2020-08-18 12:35:27 UTC
waiting for an answer.
Comment 7 Fridolin Somers 2020-08-21 14:56:55 UTC
(In reply to Jonathan Druart from comment #5)
> How is this --deleted_barcodes flag used?
> 
> I don't understand why it is in this script.
> 
> Why don't we display an empty line instead?
> Imagine someone using it to know the number of deleted records (wc -l).

Hi,

It is used to update a portal :
After exporting modified/created records, we exported a list of deleted barcodes to remove items from the portal (they may not be in a modified record).
Barcode is enough because other datas are fetched live via ILS-DI.

An empty line does not mean anything I think.
Comment 8 Jonathan Druart 2020-08-26 13:23:55 UTC
Pushed to master for 20.11, thanks to everybody involved!
Comment 9 Lucas Gass (lukeg) 2020-09-04 20:20:42 UTC
backported to 20.05.x for 20.05.04
Comment 10 Aleisha Amohia 2020-09-10 04:43:29 UTC
enhancement, not backported to 19.11.x
Comment 11 Martin Renvoize (ashimema) 2020-10-15 13:15:08 UTC Comment hidden (obsolete)