Bug 25608 - (regression) Inventory is broken
Summary: (regression) Inventory is broken
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low major (vote)
Assignee: Didier Gautheron
QA Contact: Tomás Cohen Arazi
URL:
Keywords:
Depends on: 23463
Blocks: 25167
  Show dependency treegraph
 
Reported: 2020-05-27 01:54 UTC by Didier Gautheron
Modified: 2021-12-13 21:09 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
20.05


Attachments
Bug 25608: Regression - Bug 23463 broke inventory (2.11 KB, patch)
2020-05-27 02:22 UTC, Didier Gautheron
Details | Diff | Splinter Review
Bug 25608: (bug 23463 follow-up) Fix inventory regression (2.33 KB, patch)
2020-05-27 07:55 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 25608: (bug 23463 follow-up) Fix inventory regression (2.38 KB, patch)
2020-05-27 12:05 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Didier Gautheron 2020-05-27 01:54:53 UTC
need to use unblessed items.

   Test plan :
    - Create a biblio with default framework
    - Create an item with barcode='000AAA1', callnumber='ZZZAAA1' 
    - Create an item with barcode='000AAA2', callnumber='ZZZAAA2' 
    - Create a file 'barecodes.txt' containing 2 lines '000AAA1' and '000AAA2'
    - Go to inventory tool : /cgi-bin/koha/tools/inventory.pl
    - Choose file in 'Barcode file'
    - Enter item callnumber between 'ZZZ' and 'ZZZa'
    - Check 'Compare barcodes list to results'
    - Check '
    - Submit
    => without patch, you get an error trace

Error trace

Can't call method "title" on an undefined value at /kohadevbox/koha/tools/inventory.pl line 347, <$fh> line 2.
 at /kohadevbox/koha/tools/inventory.pl line 347

    in (eval) at /kohadevbox/koha/tools/inventory.pl line 347

      344:     : $inventorylist // [];
      345: for my $item ( @$loop ) {
      346:     my $biblio = Koha::Biblios->find( $item->{biblionumber} );
      347:     $item->{title} = $biblio->title;
      348:     $item->{author} = $biblio->author;
      349: }
      350:
Comment 1 Didier Gautheron 2020-05-27 02:22:43 UTC
Created attachment 105373 [details] [review]
Bug 25608: Regression - Bug 23463 broke inventory

Test plan :
    - Create a biblio with default framework
    - Create an item with barcode='000AAA1', callnumber='ZZZAAA1'
    - Create an item with barcode='000AAA2', callnumber='ZZZAAA2'
    - Create a file 'barecodes.txt' containing 2 lines '000AAA1' and '000AAA2'
    - Go to inventory tool : /cgi-bin/koha/tools/inventory.pl
    - Choose file in 'Barcode file'
    - Enter item callnumber between 'ZZZ' and 'ZZZa'
    - Check 'Compare barcodes list to results'
    - Submit
    => without patch, you get an error trace
    - Apply patch, it works
Comment 2 Jonathan Druart 2020-05-27 07:46:02 UTC
Caused by
  commit bbb504c86f5ca0a474365d4839177412f415c4ee
  Bug 23463: Replace ModItem with Koha::Item->store
Comment 3 Jonathan Druart 2020-05-27 07:55:59 UTC
Created attachment 105377 [details] [review]
Bug 25608: (bug 23463 follow-up) Fix inventory regression

Follow-up work
  commit bbb504c86f5ca0a474365d4839177412f415c4ee
  Bug 23463: Replace ModItem with Koha::Item->store

Test plan :
    - Create a biblio with default framework
    - Create an item with barcode='000AAA1', callnumber='ZZZAAA1'
    - Create an item with barcode='000AAA2', callnumber='ZZZAAA2'
    - Create a file 'barecodes.txt' containing 2 lines '000AAA1' and '000AAA2'
    - Go to inventory tool : /cgi-bin/koha/tools/inventory.pl
    - Choose file in 'Barcode file'
    - Enter item callnumber between 'ZZZ' and 'ZZZa'
    - Check 'Compare barcodes list to results'
    - Submit
    => without patch, you get an error trace
    - Apply patch, it works

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Amended commit title.
Comment 4 Tomás Cohen Arazi 2020-05-27 12:05:21 UTC
Created attachment 105391 [details] [review]
Bug 25608: (bug 23463 follow-up) Fix inventory regression

Follow-up work
  commit bbb504c86f5ca0a474365d4839177412f415c4ee
  Bug 23463: Replace ModItem with Koha::Item->store

Test plan :
    - Create a biblio with default framework
    - Create an item with barcode='000AAA1', callnumber='ZZZAAA1'
    - Create an item with barcode='000AAA2', callnumber='ZZZAAA2'
    - Create a file 'barecodes.txt' containing 2 lines '000AAA1' and '000AAA2'
    - Go to inventory tool : /cgi-bin/koha/tools/inventory.pl
    - Choose file in 'Barcode file'
    - Enter item callnumber between 'ZZZ' and 'ZZZa'
    - Check 'Compare barcodes list to results'
    - Submit
    => without patch, you get an error trace
    - Apply patch, it works

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Amended commit title.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 5 Jonathan Druart 2020-05-29 09:48:37 UTC
Pushed to master for 20.05
Comment 6 Aleisha Amohia 2020-06-12 02:28:14 UTC
missing dependencies, not backported to 19.11.x