From 1d3159fc4244fb9ba6e1d7d94537b366c8654c4c 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'. --- Koha/Illrequest.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Koha/Illrequest.pm b/Koha/Illrequest.pm index ac0b5d5afc..7778dbe802 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.11.0