From 608cf1b073d0a61f14967c64ef1b55d3cec218d1 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Tue, 23 Jul 2019 16:39:18 -0300 Subject: [PATCH] Bug 23329: (follow-up) Use any instead of grep Signed-off-by: Tomas Cohen Arazi Signed-off-by: Marcel de Rooy Signed-off-by: Martin Renvoize Signed-off-by: Kyle M Hall Signed-off-by: Martin Renvoize --- opac/tracklinks.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/opac/tracklinks.pl b/opac/tracklinks.pl index 329addf0b5..31fc930b0e 100755 --- a/opac/tracklinks.pl +++ b/opac/tracklinks.pl @@ -25,6 +25,7 @@ use C4::Biblio; use Koha::Items; use Koha::Linktracker; use CGI qw ( -utf8 ); +use List::MoreUtils qw(any); my $cgi = new CGI; my $uri = $cgi->param('uri') || ''; @@ -55,7 +56,7 @@ if ($uri && ($biblionumber || $itemnumber) ) { my $record = C4::Biblio::GetMarcBiblio({ biblionumber => $biblionumber }); my $marc_urls = C4::Biblio::GetMarcUrls($record, C4::Context->preference('marcflavour')); - if ( ( grep { $_ eq $uri } map { $_->{MARCURL} } @$marc_urls ) + if ( ( any { $_ eq $uri } map { $_->{MARCURL} } @$marc_urls ) || Koha::Items->search( { itemnumber => $itemnumber, uri => $uri } )->count ) { $tracker->trackclick( -- 2.39.5