Bug 26134: (bug 23463 follow-up) Fix add to basket from staged file
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Thu, 6 Aug 2020 10:50:36 +0000 (12:50 +0200)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 19 Aug 2020 06:24:43 +0000 (08:24 +0200)
There is a ->store call missing when we attempt to create a new item.

Test plan:
- set at least one value in MARCItemFieldsToOrder
- add to a basket via staged file with at least one value matching your MARCItemFields mappings
- set required fields for your order and click Save
=> Without this patch you got:
receive error: "DBIx::Class::Storage::DBI::_dbh_execute(): Column 'itemnumber' cannot be null at /kohadevbox/koha/Koha/Acquisition/Order.pm line 113
 at /usr/share/perl5/DBIx/Class/Exception.pm line 77"
=> With this patch applied the order has been created successfully

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

acqui/addorderiso2709.pl

index 8d394d3..91c3017 100755 (executable)
@@ -237,7 +237,7 @@ if ($op eq ""){
                     replacementprice    => $replacementprices[$i],
                     itemcallnumber      => $itemcallnumbers[$i],
                 }
-            );
+            )->store;
             push( @itemnumbers, $item->itemnumber );
         }
         if ($itemcreation == 1) {