Bug 22288

Summary: Barcode file does not work in modifying items in batch
Product: Koha Reporter: Federico Paiz <federicoantoniopaiz>
Component: CatalogingAssignee: Nick Clemens <nick>
Status: CLOSED FIXED QA Contact: Martin Renvoize <martin.renvoize>
Severity: major    
Priority: P5 - low CC: bwsdonna, katrin.fischer, lucas, m.de.rooy, magnus, martin.renvoize, nick
Version: 18.11   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
19.05.00, 18.11.05
Bug Depends on: 21183    
Bug Blocks:    
Attachments: screen
txt
Bug 22288: Correct item search in batchMod by barcode file
Bug 22288: Correct item search in batchMod by barcode file

Description Federico Paiz 2019-02-07 13:36:38 UTC
Created attachment 84847 [details]
screen

in going through txt the inventory ( Home › Tools › Batch item modification ), 
it gives me as a result :  



Can't use string ("0") as an ARRAY ref while "strict refs" in use at /usr/share/koha/intranet/cgi-bin/tools/batchMod.pl line 251, <$fh> line 69.
Comment 1 Katrin Fischer 2019-02-07 13:38:50 UTC
What did your .txt file look like? Where there any empty lines or 0 in lines?
Comment 2 Federico Paiz 2019-02-07 13:44:12 UTC
Created attachment 84848 [details]
txt


it looks like this
Comment 3 Federico Paiz 2019-02-08 16:15:07 UTC
   
the code is fine?

/usr/share/koha/intranet/cgi-bin/tools/batchMod.pl



@contentlist = uniq @contentlist;
      if ($filecontent eq 'barcode_file') {
       my $existing_items = Koha::Items->search({ itemnumber =>\@contentlist });
       @itemnumbers = $existing_items->get_column('itemnumber');
       my %exists = map {$_=>1}@{$existing_items->get_column('barcode')};
       @notfoundbarcodes = grep { !$exists{$_} } @contentlist;
     }
Comment 4 Nick Clemens 2019-04-09 00:10:21 UTC
Created attachment 87571 [details] [review]
Bug 22288: Correct item search in batchMod by barcode file

To test:
1 - Have a list of barcodes that exist in your catalog
2 - Go to Tools->Batch item modification
3 - Attempt to modify items using the list
4 - Get an error page
5 - Apply patch
6 - Repeat
7 - Modification should work correctly
Comment 5 Martin Renvoize 2019-04-09 06:43:08 UTC
Created attachment 87579 [details] [review]
Bug 22288: Correct item search in batchMod by barcode file

To test:
1 - Have a list of barcodes that exist in your catalog
2 - Go to Tools->Batch item modification
3 - Attempt to modify items using the list
4 - Get an error page
5 - Apply patch
6 - Repeat
7 - Modification should work correctly

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 6 Martin Renvoize 2019-04-09 06:43:47 UTC
Silly error, going straight for QA on this one.. No regressions found. Passed QA
Comment 7 Nick Clemens 2019-04-10 20:13:10 UTC
Awesome work all!

Pushed to master for 19.05
Comment 8 Magnus Enger 2019-04-11 06:41:09 UTC
I can confirm that this fix also works on 18.11.02.
Comment 9 Martin Renvoize 2019-04-15 11:27:10 UTC
Pushed to 18.11.x for 18.11.05
Comment 10 Lucas Gass 2019-04-16 20:24:02 UTC
missing dependecny, not backporting to 18.05.x