Bugzilla – Attachment 69855 Details for
Bug 19808
Reviews from deleted patrons make few scripts to explode
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19808: Handle deleted reviewers gracefully - opac-showreview
Bug-19808-Handle-deleted-reviewers-gracefully---op.patch (text/plain), 2.50 KB, created by
Jonathan Druart
on 2017-12-18 16:36:52 UTC
(
hide
)
Description:
Bug 19808: Handle deleted reviewers gracefully - opac-showreview
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2017-12-18 16:36:52 UTC
Size:
2.50 KB
patch
obsolete
>From dcebe2229d7fe0c02d2f463102581de2a96bc511 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 18 Dec 2017 13:32:14 -0300 >Subject: [PATCH] Bug 19808: Handle deleted reviewers gracefully - > opac-showreview > >Test plan: >- Create reviews >- Delete some reviewers >- Enable OpacShowRecentComments >- Go to opac/opac-showreviews.pl >- Go to opac-showreviews.pl?format=rss >--- > opac/opac-showreviews.pl | 25 ++++++++++++++----------- > 1 file changed, 14 insertions(+), 11 deletions(-) > >diff --git a/opac/opac-showreviews.pl b/opac/opac-showreviews.pl >index b8441672f2..a711b7fa3a 100755 >--- a/opac/opac-showreviews.pl >+++ b/opac/opac-showreviews.pl >@@ -93,7 +93,6 @@ for my $result (@$reviews){ > my $biblioitem = $biblio->biblioitem; > my $record = GetMarcBiblio({ biblionumber => $biblionumber }); > my $frameworkcode = GetFrameworkCode($biblionumber); >- my $borr = Koha::Patrons->find( $result->{borrowernumber} )->unblessed; > $result->{normalized_upc} = GetNormalizedUPC($record,$marcflavour); > $result->{normalized_ean} = GetNormalizedEAN($record,$marcflavour); > $result->{normalized_oclc} = GetNormalizedOCLCNumber($record,$marcflavour); >@@ -108,17 +107,21 @@ for my $result (@$reviews){ > $result->{size} = $biblioitem->size; > $result->{notes} = $biblioitem->notes; > $result->{timestamp} = $biblioitem->timestamp; >- $result->{borrtitle} = $borr->{'title'}; >- $result->{firstname} = $borr->{'firstname'}; >- $result->{surname} = $borr->{'surname'}; >- $result->{userid} = $borr->{'userid'}; >- if ($libravatar_enabled and $borr->{'email'}) { >- $result->{avatarurl} = libravatar_url(email => $borr->{'email'}, size => 40, https => $ENV{HTTPS}); >- } > >- if ($result->{borrowernumber} eq $borrowernumber) { >- $result->{your_comment} = 1; >- } >+ my $patron = Koha::Patrons->find( $result->{borrowernumber} ); >+ if ( $patron ) { >+ $result->{borrtitle} = $patron->title; >+ $result->{firstname} = $patron->firstname; >+ $result->{surname} = $patron->surname; >+ $result->{userid} = $patron->userid; >+ if ($libravatar_enabled and $patron->email) { >+ $result->{avatarurl} = libravatar_url(email => $patron->email, size => 40, https => $ENV{HTTPS}); >+ } >+ >+ if ($result->{borrowernumber} eq $borrowernumber) { >+ $result->{your_comment} = 1; >+ } >+ } > > if($format eq "rss"){ > my $rsstimestamp = eval { dt_from_string( $result->{datereviewed} ); }; >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 19808
:
69824
|
69828
|
69853
|
69854
|
69855
|
69856
|
69926
|
69934
|
69935
|
69936
|
69937
|
69938
|
69989
|
69990
|
69991
|
69992
|
69993