From 2ab79e3b5299f9c6af5d0a9a5bb9cda0adee60c9 Mon Sep 17 00:00:00 2001 From: Alex Sassmannshausen Date: Fri, 12 May 2017 12:12:39 +0200 Subject: [PATCH] Bug 7317: Bugfix: Ensure current branch exists. * Koha/Illrequest.pm (generic_confirm): Load $branch variable earlier, with 'current_branchcode'. Signed-off-by: Magnus Enger --- Koha/Illrequest.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Koha/Illrequest.pm b/Koha/Illrequest.pm index ac0b5d5..7778dbe 100644 --- a/Koha/Illrequest.pm +++ b/Koha/Illrequest.pm @@ -730,6 +730,8 @@ attempts to submit the email. sub generic_confirm { my ( $self, $params ) = @_; + my $branch = Koha::Libraries->find($params->{current_branchcode}) + || die "Invalid current branchcode. Are you logged in as the database user?"; if ( !$params->{stage}|| $params->{stage} eq 'init' ) { my $draft->{subject} = "ILL Request"; $draft->{body} = <find($params->{current_branchcode}) - || die "Invalid current branchcode. Are you logged in as the database user?"; my @address = map { $branch->$_ } qw/ branchname branchaddress1 branchaddress2 branchaddress3 branchzip branchcity branchstate branchcountry branchphone -- 2.7.4