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 <aleishaamohia@hotmail.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
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
return unless $self->branchcode();
- return Koha::Libraries->find( $self->branchcode() );
+ return scalar Koha::Libraries->find( $self->branchcode() );
}
=head3 type