From 8cc6ff8fc3346b1a0fa163b3c285d706b4b02df7 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 5 Jul 2017 20:03:24 -0300 Subject: [PATCH] [SIGNED-OFF] 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. Signed-off-by: Aleisha Amohia --- Koha/Club.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Koha/Club.pm b/Koha/Club.pm index f55bfb5..09a510b 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.1.4