Skip to content

Commit

Permalink
Bug 21018: Fix TrackClicks for 952$u
Browse files Browse the repository at this point in the history
Caused by
  commit 51b6cf2
  Bug 19847: Track links within the records and 404 for others

We should also accept uri stored in items.uri (952$u)

Test plan:
- Turn on TrackClicks
- Defined uri for some items
- At the OPAC click on the link (from opac-detail.pl)
=> Without this patch you will get 404 (redirected from tracklinks.pl)
=> With this patch applied you will be redirected correctly and the
linktracker will be filled correctly

Signed-off-by: Katrin Fischer <[email protected]>

Signed-off-by: Katrin Fischer <[email protected]>
Signed-off-by: Martin Renvoize <[email protected]>

Signed-off-by: Nick Clemens <[email protected]>
  • Loading branch information
joubu authored and kidclamp committed Aug 8, 2018
1 parent 038e401 commit d14ed73
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion opac/tracklinks.pl
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
use C4::Context;
use C4::Auth qw(checkauth);
use C4::Biblio;
use Koha::Items;
use Koha::Linktracker;
use CGI qw ( -utf8 );

Expand Down Expand Up @@ -57,7 +58,9 @@

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 ( ( grep { $_ eq $uri } map { $_->{MARCURL} } @$marc_urls )
|| Koha::Items->search( { uri => $uri } )->count )
{
$tracker->trackclick(
{
uri => $uri,
Expand Down

0 comments on commit d14ed73

Please sign in to comment.