Bugzilla – Attachment 45256 Details for
Bug 15270
Koha::Objects->find can exploded if searching for nonexistent record
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[FOR 3.20.X ONLY] Bug 15270: Make Koha::Objects->find return undef instead of crashing
Bug-15270-Make-KohaObjects-find-return-undef-inste.patch (text/plain), 1.12 KB, created by
Jonathan Druart
on 2015-12-01 10:18:10 UTC
(
hide
)
Description:
[FOR 3.20.X ONLY] Bug 15270: Make Koha::Objects->find return undef instead of crashing
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2015-12-01 10:18:10 UTC
Size:
1.12 KB
patch
obsolete
>From 13863e83744eefa9e1141e3c9dbba60dc4ed8922 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 1 Dec 2015 10:16:43 +0000 >Subject: [PATCH] Bug 15270: Make Koha::Objects->find return undef instead of > crashing > >On 3.20.05, if AnonymousPatron is set to a nonexistent borrowernumber, the about.pl crashes with > > DBIC result type isn't of the type Borrower at /home/koha/src/Koha/Objects.pm line 87. > >This was fixed on master by > commit 6882949b1b3bd1284e3d2877244a64edee3883ca > Date: Wed Apr 8 06:38:34 2015 -0400 > Bug 13967 - System preferences need a package > >Test plan: >Set the AnonymousPatron pref to a nonexistent borrowernumber >Go on about.pl >Without this patch, you get the error. >--- > Koha/Objects.pm | 2 ++ > 1 file changed, 2 insertions(+) > >diff --git a/Koha/Objects.pm b/Koha/Objects.pm >index f347157..8ef6390 100644 >--- a/Koha/Objects.pm >+++ b/Koha/Objects.pm >@@ -84,6 +84,8 @@ sub find { > > my $result = $self->_resultset()->find($id); > >+ return unless $result; >+ > my $object = $self->object_class()->_new_from_dbic( $result ); > > return $object; >-- >2.1.0
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 15270
:
45254
|
45255
|
45256
|
45262
|
45263
|
45438
|
45439