From aefb12ef0e123fb8a56c4e7433d7d3d34e7c75c2 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 21 Aug 2020 12:02:07 +0200 Subject: [PATCH] Bug 18501: Don't use paidfor for DB fields not mapped with a MARC field On "Bug 25964: Prevent data loss when editing items from a MARC record" we picked paidfor as an example, but it has a specific behaviour and is now handled in Koha::Item->store. Let's pick another one, new_status --- t/db_dependent/Items.t | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/t/db_dependent/Items.t b/t/db_dependent/Items.t index 3da406ac9e..4e7fecb2e3 100755 --- a/t/db_dependent/Items.t +++ b/t/db_dependent/Items.t @@ -984,7 +984,7 @@ subtest 'ModItemFromMarc' => sub { my $item = Koha::Items->find($itemnumber); is( $item->itemlost, 1, 'itemlost picked from the item marc'); - $item->paidfor("this is something")->store; + $item->new_status("this is something")->store; my $updated_item_record = new MARC::Record; $updated_item_record->append_fields( @@ -996,8 +996,8 @@ subtest 'ModItemFromMarc' => sub { my $updated_item = ModItemFromMarc($updated_item_record, $biblio->biblionumber, $itemnumber); is( $updated_item->{itemlost}, 0, 'itemlost should have been reset to the default value in DB' ); - is( $updated_item->{paidfor}, "this is something", "Non mapped field has not been reset" ); - is( Koha::Items->find($itemnumber)->paidfor, "this is something" ); + is( $updated_item->{new_status}, "this is something", "Non mapped field has not been reset" ); + is( Koha::Items->find($itemnumber)->new_status, "this is something" ); $schema->storage->txn_rollback; }; -- 2.20.1