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>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
} else {
my $item = Koha::Items->find({barcode => $barcode});
if ( $item ) {
- my $item_unblessed = $item->unblessed;
# Modify date last seen for scanned items, remove lost status
$item->set({ itemlost => 0, datelastseen => $date })->store;
+ my $item_unblessed = $item->unblessed;
$moddatecount++;
- # update item hash accordingly
- $item_unblessed->{itemlost} = 0;
- $item_unblessed->{datelastseen} = $date;
unless ( $dont_checkin ) {
$qonloan->execute($barcode);
if ($qonloan->rows){
}
}
}
- push @scanned_items, $item;
+ push @scanned_items, $item_unblessed;
} else {
push @errorloop, { barcode => $barcode, ERR_BARCODE => 1 };
}