[Koha-bugs] [Bug 22006] Koha::Account::Line->item should return undef if no item linked

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Tue Jan 15 19:43:55 CET 2019


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22006

Tomás Cohen Arazi <tomascohen at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #83247|0                           |1
        is obsolete|                            |

--- Comment #6 from Tomás Cohen Arazi <tomascohen at gmail.com> ---
Created attachment 84001
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=84001&action=edit
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 at inLibro.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen at theke.io>

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list