From dfa5841212fd525de8c1cdf60750be148753cac5 Mon Sep 17 00:00:00 2001 From: Victor Grousset Date: Thu, 18 Oct 2018 11:54:58 +0200 Subject: [PATCH] Bug 21587: don't drop patrons to notify in order creation It only worked on modification. == Test plan == 1. have/create a active budget 2. have/create a fund 3. have/create a vendor with minimal info 4. create a basket with minimal info 5. add an order line to the basket Add a user in "To notify on receiving" 6. Modify the order 7. The patrons isn't here. This is the bug 8. Add a user in "To notify on receiving" 9. Save 10. Modify the order 11. The patron is here now 12. Apply this patch 13. Retry step 5 to 11 and patron should be saved on order creation 14. Celebrate! :D Signed-off-by: Jonathan Druart --- acqui/addorder.pl | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/acqui/addorder.pl b/acqui/addorder.pl index 17b50e6185..2c269e01ed 100755 --- a/acqui/addorder.pl +++ b/acqui/addorder.pl @@ -290,14 +290,13 @@ if ( $basket->{is_standing} || $orderinfo->{quantity} ne '0' ) { my $order = Koha::Acquisition::Order->new($orderinfo); if ( $orderinfo->{ordernumber} ) { ModOrder($orderinfo); - my $order_users_ids = $input->param('users_ids'); - my @order_users = split( /:/, $order_users_ids ); - - ModOrderUsers( $orderinfo->{ordernumber}, @order_users ); } else { # else, it's a new line $order->store; } + my $order_users_ids = $input->param('users_ids'); + my @order_users = split( /:/, $order_users_ids ); + ModOrderUsers( $order->ordernumber, @order_users ); # now, add items if applicable if ($basket->effective_create_items eq 'ordering') { -- 2.11.0