]> git.koha-community.org Git - koha.git/commit
Bug 22006: Handle undefined itemnumber for Koha::Account::Line->item
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Fri, 14 Dec 2018 19:15:24 +0000 (16:15 -0300)
committerLucas Gass <lucas@bywatersolutions.com>
Wed, 23 Jan 2019 23:11:49 +0000 (23:11 +0000)
commitabaefea4187b78086aae40b91cdd0c2745eee504
tree4c35eecc944b79d4fa5037a06d14a8a61b642b9a
parent9b29c0ed84cf7eca651bd544d892994d638245ae
Bug 22006: Handle undefined itemnumber for Koha::Account::Line->item

If there is no item linked to an account line, the ->item method should return undef.
Without this patch it explodes with:
Carp::croak('DBIC result _type  isn\'t of the _type Item') called at /home/vagrant/kohaclone/Koha/Object.pm line 102

Exists since the introduction of this method by bug 12001

Reported on bug 19489 comment 18.

Test plan:
  prove t/db_dependent/Koha/Account/Lines.t
must return green

Signed-off-by: Pierre-Marc Thibault <pierre-marc.thibault@inLibro.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 6c8089b40fef1b59ab056bae8817933afdb2fcc3)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 07cd6560b5d8334b11ac8c998c1d1156d01a4bcb)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Koha/Account/Line.pm