Bug 23329: (follow-up) Use any instead of grep

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>
This commit is contained in:
Tomás Cohen Arazi 2019-07-23 16:39:18 -03:00 committed by Martin Renvoize
parent e11b1e6d3c
commit 608cf1b073
Signed by: martin.renvoize
GPG key ID: 422B469130441A0F

View file

@ -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(