Bugzilla – Attachment 83247 Details for
Bug 22006
Koha::Account::Line->item should return undef if no item linked
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22006: Handle undefined itemnumber for Koha::Account::Line->item
Bug-22006-Handle-undefined-itemnumber-for-KohaAcco.patch (text/plain), 1.15 KB, created by
Pierre-Marc Thibault
on 2018-12-14 20:08:13 UTC
(
hide
)
Description:
Bug 22006: Handle undefined itemnumber for Koha::Account::Line->item
Filename:
MIME Type:
Creator:
Pierre-Marc Thibault
Created:
2018-12-14 20:08:13 UTC
Size:
1.15 KB
patch
obsolete
>From 9d395bb71ab7b83c7fb05c48af4a1cd832f5b0a4 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 14 Dec 2018 16:15:24 -0300 >Subject: [PATCH] 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> >--- > Koha/Account/Line.pm | 1 + > 1 file changed, 1 insertion(+) > >diff --git a/Koha/Account/Line.pm b/Koha/Account/Line.pm >index 3573e60..9a53847 100644 >--- a/Koha/Account/Line.pm >+++ b/Koha/Account/Line.pm >@@ -48,6 +48,7 @@ Return the item linked to this account line if exists > sub item { > my ( $self ) = @_; > my $rs = $self->_result->itemnumber; >+ return unless $rs; > return Koha::Item->_new_from_dbic( $rs ); > } > >-- >2.7.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 22006
:
83240
|
83241
|
83246
|
83247
|
84000
|
84001