To recreate: Create a basket Add an order Cancel the order and delete the record Error loading basket!
Created attachment 62511 [details] [review] Bug 18467 - Error calling count on undefined bib in basket.pl if order cancelled and record deleted To test: 1 - Create a basket 2 - Order a bib 3 - Cancel order and delete record 4 - You cannot view basket 5 - Apply patch 6 - View basket 7 - There should not be an error r calling count on undefined bib in basket.pl if order cancelled and record deleted
Created attachment 62514 [details] [review] Bug 18467 - Error calling count on undefined bib in basket.pl if order cancelled and record deleted To test: 1 - Create a basket 2 - Order a bib 3 - Cancel order and delete record 4 - You cannot view basket 5 - Apply patch 6 - View basket 7 - There should not be an error r calling count on undefined bib in basket.pl if order cancelled and record deleted Followed test plan and it works as specified Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>
The error is: Can't call method "items" on an undefined value at /home/vagrant/kohaclone/acqui/basket.pl line 470.
I think I have a counter-patch.
Created attachment 62537 [details] [review] Bug 18467: Handle orders with deleted biblio when viewing a basket If the bibliographic record of an order has been removed, $order->{bibionumber} is undefined. We need to handle this specific case correctly. To test: 1 - Create a basket 2 - Order a bib 3 - Cancel order and delete record 4 - You cannot view basket 5 - Apply patch 6 - View basket 7 - There should not be an error r calling count on undefined bib in basket.pl if order cancelled and record deleted
Nick, Reading the code I think it's important to clearly highlight this specific case. Moreover if the bibliographic record does no longer exist, we can skip the whole block. Let me know if you agree.
Looks right to me, much cleaner.
Created attachment 62570 [details] [review] Bug 18467: Handle orders with deleted biblio when viewing a basket If the bibliographic record of an order has been removed, $order->{bibionumber} is undefined. We need to handle this specific case correctly. To test: 1 - Create a basket 2 - Order a bib 3 - Cancel order and delete record 4 - You cannot view basket 5 - Apply patch 6 - View basket 7 - There should not be an error r calling count on undefined bib in basket.pl if order cancelled and record deleted
Created attachment 62571 [details] [review] Bug 18467: Handle orders with deleted biblio when viewing a basket If the bibliographic record of an order has been removed, $order->{bibionumber} is undefined. We need to handle this specific case correctly. To test: 1 - Create a basket 2 - Order a bib 3 - Cancel order and delete record 4 - You cannot view basket 5 - Apply patch 6 - View basket 7 - There should not be an error r calling count on undefined bib in basket.pl if order cancelled and record deleted Followed test plan, works as intended Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>
Created attachment 62654 [details] [review] Bug 18467: Handle orders with deleted biblio when viewing a basket If the bibliographic record of an order has been removed, $order->{bibionumber} is undefined. We need to handle this specific case correctly. To test: 1 - Create a basket 2 - Order a bib 3 - Cancel order and delete record 4 - You cannot view basket 5 - Apply patch 6 - View basket 7 - There should not be an error r calling count on undefined bib in basket.pl if order cancelled and record deleted Followed test plan, works as intended Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Pushed to master for 17.05, thanks Jonathan!
This doesn't apply cleanly on 16.11.x, please rebase/comment if it's needed there.
Missed the dependency last time - tested and the problem isn't present in 16.11.x.