Bug 21018: Fix TrackClicks for 952$u
Caused by
commit 51b6cf2aaf
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 <katrin.fischer.83@web.de>
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>
This commit is contained in:
parent
038e4011d4
commit
d14ed73744
1 changed files with 4 additions and 1 deletions
|
@ -22,6 +22,7 @@ use Modern::Perl;
|
||||||
use C4::Context;
|
use C4::Context;
|
||||||
use C4::Auth qw(checkauth);
|
use C4::Auth qw(checkauth);
|
||||||
use C4::Biblio;
|
use C4::Biblio;
|
||||||
|
use Koha::Items;
|
||||||
use Koha::Linktracker;
|
use Koha::Linktracker;
|
||||||
use CGI qw ( -utf8 );
|
use CGI qw ( -utf8 );
|
||||||
|
|
||||||
|
@ -57,7 +58,9 @@ if ($uri) {
|
||||||
|
|
||||||
my $record = C4::Biblio::GetMarcBiblio({ biblionumber => $biblionumber });
|
my $record = C4::Biblio::GetMarcBiblio({ biblionumber => $biblionumber });
|
||||||
my $marc_urls = C4::Biblio::GetMarcUrls($record, C4::Context->preference('marcflavour'));
|
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(
|
$tracker->trackclick(
|
||||||
{
|
{
|
||||||
uri => $uri,
|
uri => $uri,
|
||||||
|
|
Loading…
Reference in a new issue