Browse Source

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>
remotes/origin/19.11.x
Tomás Cohen Arazi 5 years ago
committed by Martin Renvoize
parent
commit
608cf1b073
Signed by: martin.renvoize GPG Key ID: 422B469130441A0F
  1. 3
      opac/tracklinks.pl

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

Loading…
Cancel
Save