Bug 22690: (QA follow-up) Make bib-level hold object actually bib-level
authorJoonas Kylmälä <joonas.kylmala@helsinki.fi>
Fri, 28 May 2021 10:57:53 +0000 (13:57 +0300)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Fri, 27 Aug 2021 09:02:41 +0000 (11:02 +0200)
We need to pass undef itemnumber to build_object() to actually have a
hold without an item tied to it. Otherwise build_object() will create
automatically an item for us (thus making it an item-level hold)

To test:
 $ prove t/db_dependent/Koha/Item.t

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
t/db_dependent/Koha/Item.t

index 2080a93..dc37bc5 100755 (executable)
@@ -927,6 +927,7 @@ subtest 'move_to_biblio() tests' => sub {
         class => 'Koha::Holds',
         value  => {
             biblionumber => $source_biblionumber,
+            itemnumber => undef,
         },
     });
     my $item_level_hold1 = $builder->build_object({