From b149e6102bf95a743421cef6aa35a750d82948af 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 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Bug reproduced, is fixed by this patch. Signed-off-by: Marc Véron --- 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.1.4