Bug 33885: Make Koha::Acq::Order->creator return undef if no creator
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 7 Jun 2023 09:05:18 +0000 (11:05 +0200)
committerTomas Cohen Arazi <tomascohen@theke.io>
Fri, 16 Jun 2023 13:55:18 +0000 (10:55 -0300)
commit1c3a35418ea3defb50debbab4fd334bee4eb5229
tree98cc503a871bf31f19cd2d5d5b04c4b6d0e5448c
parent2ab07927e23e05976a8d2f0171d1e3fe2c7b8c34
Bug 33885: Make Koha::Acq::Order->creator return undef if no creator

If the account of the creator of an order has been deleted we should
return undef here, instead of crashing with
GET /api/v1/acquisitions/orders: unhandled exception (Mojo::Exception)<<DBIC result _type  isn't of the _type Borrower at /kohadevbox/koha/Koha/Objects.pm line 445.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Koha/Acquisition/Order.pm
t/db_dependent/Koha/Acquisition/Order.t