From c8c722b08b724bfaf6c3ade852bef4ef00d3c0ae Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 18 Apr 2017 13:11:29 -0300 Subject: [PATCH] Bug 18403: Fix patron creation memberentry.pl can be called to create a new patron, in that case the patron does not exist yet. Signed-off-by: Jon McGowan --- members/memberentry.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/members/memberentry.pl b/members/memberentry.pl index bda4f96..7cc3b34 100755 --- a/members/memberentry.pl +++ b/members/memberentry.pl @@ -78,7 +78,7 @@ my ($template, $loggedinuser, $cookie) my $borrowernumber = $input->param('borrowernumber'); my $patron = Koha::Patrons->find($borrowernumber); my $userenv = C4::Context->userenv; -if ( $userenv and $userenv->{number} ) { # Allow DB user to create a superlibrarian patron +if ( $patron and $userenv and $userenv->{number} ) { # Allow DB user to create a superlibrarian patron my $logged_in_user = Koha::Patrons->find( $loggedinuser ) or die "Not logged in"; output_and_exit_if_error( $input, $cookie, $template, { module => 'members', logged_in_user => $logged_in_user, current_patron => $patron } ); } -- 2.1.4