Bugzilla – Attachment 64834 Details for
Bug 18870
Patron Clubs breaks when creating a club
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18870: Force scalar context for Koha::Club methods
Bug-18870-Force-scalar-context-for-KohaClub-method.patch (text/plain), 1.39 KB, created by
Jonathan Druart
on 2017-07-05 23:07:28 UTC
(
hide
)
Description:
Bug 18870: Force scalar context for Koha::Club methods
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2017-07-05 23:07:28 UTC
Size:
1.39 KB
patch
obsolete
>From 1e4f6ffcae454fef9c419c287e2bbb5271d929f9 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 5 Jul 2017 20:03:24 -0300 >Subject: [PATCH] Bug 18870: Force scalar context for Koha::Club methods > >These 2 methods are called from the template in list context. >However since bug 18539 Koha::Objects->find can no longer be called in >list context. >Forcing the context to scalar fixes the problem and should not >introduced side-effects. > >Test plan: >- Create a club template >- Create a club using this template >=> Without this patch you should no longer get the following error: >Template process failed: undef error - Cannot use "->find" in list >context at /home/vagrant/kohaclone/Koha/Club.pm line 51. >--- > Koha/Club.pm | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > >diff --git a/Koha/Club.pm b/Koha/Club.pm >index f55bfb54a8..09a510b64d 100644 >--- a/Koha/Club.pm >+++ b/Koha/Club.pm >@@ -48,7 +48,7 @@ sub club_template { > > return unless $self->club_template_id(); > >- return Koha::Club::Templates->find( $self->club_template_id() ); >+ return scalar Koha::Club::Templates->find( $self->club_template_id() ); > } > > =head3 club_fields >@@ -84,7 +84,7 @@ sub branch { > > return unless $self->branchcode(); > >- return Koha::Libraries->find( $self->branchcode() ); >+ return scalar Koha::Libraries->find( $self->branchcode() ); > } > > =head3 type >-- >2.11.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 18870
:
64694
|
64834
|
64836
|
64837