From fbe0c0cf6f088c0a79447dc96caa7b738f3d04f9 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 18 Dec 2017 13:32:02 -0300 Subject: [PATCH] Bug 19808: (follow-up) Handle deleted reviewers gracefully - opac-detail Make the tests easier to read Signed-off-by: Jon Knight Signed-off-by: Kyle M Hall Signed-off-by: Jonathan Druart Signed-off-by: Nick Clemens --- opac/opac-detail.pl | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl index 9b75015303..bdef7d8b5e 100755 --- a/opac/opac-detail.pl +++ b/opac/opac-detail.pl @@ -845,13 +845,15 @@ if ( C4::Context->preference('reviewson') ) { my $patron = Koha::Patrons->find( $review->{borrowernumber} ); # setting some borrower info into this hash - $review->{patron} = $patron; - if ( $libravatar_enabled and $patron and $patron->email ) { - $review->{avatarurl} = libravatar_url( email => $patron->email, https => $ENV{HTTPS} ); - } + if ( $patron ) { + $review->{patron} = $patron; + if ( $libravatar_enabled and $patron->email ) { + $review->{avatarurl} = libravatar_url( email => $patron->email, https => $ENV{HTTPS} ); + } - if ( $patron and $patron->borrowernumber eq $borrowernumber ) { - $loggedincommenter = 1; + if ( $patron->borrowernumber eq $borrowernumber ) { + $loggedincommenter = 1; + } } } } -- 2.39.5