Bug 23329: (follow-up) Use any instead of grep
authorTomas Cohen Arazi <tomascohen@theke.io>
Tue, 23 Jul 2019 19:39:18 +0000 (16:39 -0300)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Wed, 27 Nov 2019 11:30:18 +0000 (11:30 +0000)
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
opac/tracklinks.pl

index 329addf..31fc930 100755 (executable)
@@ -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(