Bug 29658 - Crash on cancelling cancelled order
Summary: Crash on cancelling cancelled order
Status: Needs Signoff
Alias: None
Product: Koha
Classification: Unclassified
Component: Acquisitions (show other bugs)
Version: master
Hardware: All All
: P5 - low minor (vote)
Assignee: Marcel de Rooy
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-12-08 13:45 UTC by Marcel de Rooy
Modified: 2021-12-08 14:13 UTC (History)
1 user (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 29658: Fix crash on cancelling cancelled order (3.39 KB, patch)
2021-12-08 13:55 UTC, Marcel de Rooy
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Marcel de Rooy 2021-12-08 13:45:41 UTC
See bug 29823.
Comment 1 Marcel de Rooy 2021-12-08 13:55:03 UTC
Created attachment 128364 [details] [review]
Bug 29658: Fix crash on cancelling cancelled order

Found this crash in our 20.11 logs:
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

Not sure how to reproduce this one as it happened. But might be related to repeated clicking, backspacing etc.

Test plan:
Create a new basket and order.
Open this same basket in two browser tabs.
Cancel the order line (delete catalog record) in tab 1.
Go to second tab, try again.
Without this patch, it will crash. With this patch, an error message.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 2 Marcel de Rooy 2021-12-08 14:10:26 UTC
Hmm, this even opens up new possibilities like:

Can't call method "edi_order" on an undefined value at /usr/share/koha/acqui/basket.pl line 381

Probably by trying to delete a deleted basket?
Comment 3 Marcel de Rooy 2021-12-08 14:12:38 UTC
(In reply to Marcel de Rooy from comment #2)
> Hmm, this even opens up new possibilities like:
> 
> Can't call method "edi_order" on an undefined value at
> /usr/share/koha/acqui/basket.pl line 381
> 
> Probably by trying to delete a deleted basket?

Not sure about that. Cant exactly reproduce. Lets resolve that somewhere else..