From 5004c878a6d6ea524f6d56bae5cf20b726fe3b47 Mon Sep 17 00:00:00 2001 From: Lari Taskula Date: Thu, 4 May 2017 16:18:01 +0300 Subject: [PATCH] Bug 18538: OPAC databse user login internal server error Reproduce: 1. Go to OPAC 2. Login with the database user 3. Observe Internal Server Error Check your logs: Can't call method "is_debarred" on an undefined value at /home/koha/kohaclone/opac/opac-user.pl line 96. This patch fixes the mentioned crash. To test: 1. Reproduce the issue with above test plan 2. Apply this patch 3. Go to OPAC 4. Login with the database user 5. Observe successful login --- opac/opac-user.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/opac/opac-user.pl b/opac/opac-user.pl index 6ae7b9a..e374690 100755 --- a/opac/opac-user.pl +++ b/opac/opac-user.pl @@ -93,7 +93,8 @@ my ( $borr ) = GetMember( borrowernumber => $borrowernumber ); my ( $today_year, $today_month, $today_day) = Today(); my ($warning_year, $warning_month, $warning_day) = split /-/, $borr->{'dateexpiry'}; -my $debar = Koha::Patrons->find( $borrowernumber )->is_debarred; +my $patron = Koha::Patrons->find( $borrowernumber ); +my $debar = $patron->is_debarred if $patron; my $userdebarred; if ($debar) { -- 2.7.4