To recreate: - have a basket with at least one order - click "Cancel order and delete catalog record", confirm cancellation of order and deletion of bib - click "Delete basket", confirm deletion - get error "Cannot insert order: Mandatory parameter biblionumber is missing at /kohadevbox/koha/acqui/basket.pl line 136. at /usr/share/perl/5.28/Carp.pm line 289"
Created attachment 126585 [details] [review] Bug 29283: Don't attempt to cancel cancelled orders When deleting a basket we cancel all the contained orders - when a basket contains an order that was previously cancelled this can cause an error if the biblio was deleted When picking the orders to cancel, we should limit our search to those not already cancelled. To test: - have a basket with at least one order - click "Cancel order and delete catalog record", confirm cancellation of order and deletion of bib - click "Delete basket", confirm deletion - get error "Cannot insert order: Mandatory parameter biblionumber is missing at /kohadevbox/koha/acqui/basket.pl line 136. at /usr/share/perl/5.28/Carp.pm line 289" - apply patch - restart - delete the basket - success!
Created attachment 126589 [details] [review] Bug 29283: Don't attempt to cancel cancelled orders When deleting a basket we cancel all the contained orders - when a basket contains an order that was previously cancelled this can cause an error if the biblio was deleted When picking the orders to cancel, we should limit our search to those not already cancelled. To test: - have a basket with at least one order - click "Cancel order and delete catalog record", confirm cancellation of order and deletion of bib - click "Delete basket", confirm deletion - get error "Cannot insert order: Mandatory parameter biblionumber is missing at /kohadevbox/koha/acqui/basket.pl line 136. at /usr/share/perl/5.28/Carp.pm line 289" - apply patch - restart - delete the basket - success! Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Created attachment 127134 [details] [review] Bug 29283: Don't attempt to cancel cancelled orders When deleting a basket we cancel all the contained orders - when a basket contains an order that was previously cancelled this can cause an error if the biblio was deleted When picking the orders to cancel, we should limit our search to those not already cancelled. To test: - have a basket with at least one order - click "Cancel order and delete catalog record", confirm cancellation of order and deletion of bib - click "Delete basket", confirm deletion - get error "Cannot insert order: Mandatory parameter biblionumber is missing at /kohadevbox/koha/acqui/basket.pl line 136. at /usr/share/perl/5.28/Carp.pm line 289" - apply patch - restart - delete the basket - success! Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Created attachment 127135 [details] [review] Bug 29283: (QA follow-up) Remove code duplication We have already a search filter for active orders. Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Pushed to master for 21.11, thanks to everybody involved!
Pushed to 21.05.x for 21.05.05
Depends on Bug 23166 which added filter_by_current()
Pushed to 20.11.x for 20.11.12
Missing dependencies for 20.05.x, not affected after testing, no backport.
Found something similar: Cannot insert order: Mandatory parameter biblionumber is missing at /usr/share/koha/acqui/cancelorder.pl line 60. at /usr/share/perl/5.28/Carp.pm line 289 Carp::croak('Cannot insert order: Mandatory parameter biblionumber is missing') called at /usr/share/koha/Koha/Acquisition/Order.pm line 79 Koha::Acquisition::Order::store('Koha::Acquisition::Order=HASH(0x55f3760e2860)') called at /usr/share/koha/Koha/Acquisition/Order.pm line 189 Koha::Acquisition::Order::cancel('Koha::Acquisition::Order=HASH(0x55f3760e2860)', 'HASH(0x55f375a17ec0)') called at /usr/share/koha/acqui/cancelorder.pl line 60 cancelorder L60 (20.11) shows my $order = Koha::Acquisition::Orders->find($ordernumber); L60 $order->cancel({ reason => $reason, delete_biblio => $delete_biblio }); I am not sure how to recreate this one actually. I found it in the logs. The only way I found is opening the basket twice. Delete order in the first tab, and now delete it in the second. The second tab will crash.
Opened bug 29658