Bug 21018: Allow uris defined in the item
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 11 Jul 2018 14:29:15 +0000 (11:29 -0300)
committerNick Clemens <nick@bywatersolutions.com>
Wed, 8 Aug 2018 13:06:19 +0000 (13:06 +0000)
We need to search for uri defined for the itemnumber we passed in
parameter.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
opac/tracklinks.pl

index bc1d540..7bdb939 100755 (executable)
@@ -59,7 +59,7 @@ if ($uri) {
         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 )
-            || Koha::Items->search( { uri => $uri } )->count )
+            || Koha::Items->search( { itemnumber => $itemnumber, uri => $uri } )->count )
         {
             $tracker->trackclick(
                 {