Bug 22288 - Barcode file does not work in modifying items in batch
Summary: Barcode file does not work in modifying items in batch
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Cataloging (show other bugs)
Version: 18.11
Hardware: All All
: P5 - low major (vote)
Assignee: Nick Clemens
QA Contact: Martin Renvoize
URL:
Keywords:
Depends on: 21183
Blocks:
  Show dependency treegraph
 
Reported: 2019-02-07 13:36 UTC by Federico Paiz
Modified: 2020-06-04 20:33 UTC (History)
7 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:
19.05.00, 18.11.05


Attachments
screen (224.99 KB, image/png)
2019-02-07 13:36 UTC, Federico Paiz
Details
txt (964 bytes, text/plain)
2019-02-07 13:44 UTC, Federico Paiz
Details
Bug 22288: Correct item search in batchMod by barcode file (1.32 KB, patch)
2019-04-09 00:10 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 22288: Correct item search in batchMod by barcode file (1.39 KB, patch)
2019-04-09 06:43 UTC, Martin Renvoize
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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