Bugzilla – Attachment 119939 Details for
Bug 23271
Koha::Patron::Category should use Koha::Object::Limit::Library
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23271: Prevent crash if called without parameters
Bug-23271-Prevent-crash-if-called-without-paramete.patch (text/plain), 1.69 KB, created by
Jonathan Druart
on 2021-04-21 09:54:41 UTC
(
hide
)
Description:
Bug 23271: Prevent crash if called without parameters
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2021-04-21 09:54:41 UTC
Size:
1.69 KB
patch
obsolete
>From 502b43306512ffe0b71221d71fc1ec3bea5b6f72 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 21 Apr 2021 11:53:53 +0200 >Subject: [PATCH] Bug 23271: Prevent crash if called without parameters > >Can't use an undefined value as a HASH reference at /kohadevbox/koha/Koha/Objects/Limit/Library.pm line 87. >--- > Koha/Objects/Limit/Library.pm | 1 + > t/db_dependent/Koha/Patron/Attribute/Types.t | 6 +++++- > 2 files changed, 6 insertions(+), 1 deletion(-) > >diff --git a/Koha/Objects/Limit/Library.pm b/Koha/Objects/Limit/Library.pm >index 2f9d2d2ec6..f16fca6a3d 100644 >--- a/Koha/Objects/Limit/Library.pm >+++ b/Koha/Objects/Limit/Library.pm >@@ -71,6 +71,7 @@ sub search_with_library_limits { > ] > }; > >+ $params //= {}; > $attributes //= {}; > if ( exists $attributes->{join} ) { > if ( ref $attributes->{join} eq 'ARRAY' ) { >diff --git a/t/db_dependent/Koha/Patron/Attribute/Types.t b/t/db_dependent/Koha/Patron/Attribute/Types.t >index 3df82bcfba..c7bb0d2fbc 100755 >--- a/t/db_dependent/Koha/Patron/Attribute/Types.t >+++ b/t/db_dependent/Koha/Patron/Attribute/Types.t >@@ -388,7 +388,7 @@ subtest 'replace_library_limits() tests' => sub { > > subtest 'search_with_library_limits() tests' => sub { > >- plan tests => 5; >+ plan tests => 6; > > $schema->storage->txn_begin; > >@@ -427,6 +427,10 @@ subtest 'search_with_library_limits() tests' => sub { > > is( $results->count, 3, '3 attribute types are available with no library passed' ); > >+ $results = Koha::Patron::Attribute::Types->search_with_library_limits(); >+ >+ is( $results->count, 3, 'No crash if no params passed' ); >+ > $schema->storage->txn_rollback; > }; > >-- >2.20.1
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 23271
:
94292
|
94293
|
94294
|
119503
|
119504
|
119505
|
119529
|
119530
|
119531
|
119532
|
119533
|
119537
|
119579
|
119580
|
119581
|
119582
|
119583
|
119584
|
119772
|
119773
|
119774
|
119775
|
119776
|
119777
| 119939 |
119956
|
119957
|
120054