With Tracklinks enabled in configuration (anonymous or otherwise), URI's in 952u return a koha 404 error. However, if the link is also recorded in 856u, the 952u link works. As soon as you turn off tracklinks, 952u URI's function normally. I tested the above only on https URI's. Perhaps this is related to #18714 earlier marked as invalid?
Created attachment 76569 [details] [review] Bug 21018: Fix TrackClicks for 952$u Caused by commit 51b6cf2aafbfb45b9fcb072403b986fe3c2add53 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
Created attachment 76601 [details] [review] Bug 21018: Fix TrackClicks for 952$u Caused by commit 51b6cf2aafbfb45b9fcb072403b986fe3c2add53 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>
Important note: We certainly need to add an index on this column to boost this query.
(In reply to Jonathan Druart from comment #3) > Important note: We certainly need to add an index on this column to boost > this query. Do you mean items.uri and deleteditems.uri?
(In reply to Jonathan Druart from comment #3) > Important note: We certainly need to add an index on this column to boost > this query. Koha::Items->search( { uri => $uri } )->count You need to add biblionumber to limit the results. No need to scan the whole table.
Created attachment 76863 [details] [review] Bug 21018: Allow uris defined in the item We need to search for uri defined for the itemnumber we passed in parameter.
(In reply to Katrin Fischer from comment #4) > (In reply to Jonathan Druart from comment #3) > > Important note: We certainly need to add an index on this column to boost > > this query. > > Do you mean items.uri and deleteditems.uri? only items.uri, but with the last patch it's not needed. (In reply to Marcel de Rooy from comment #5) > (In reply to Jonathan Druart from comment #3) > > Important note: We certainly need to add an index on this column to boost > > this query. > > Koha::Items->search( { uri => $uri } )->count > > You need to add biblionumber to limit the results. No need to scan the whole > table. Oops, yes you are right. It's itemnumber actually. Maybe we should add more tests here, items.uri check should only be if itemnumber is passed. But I would prefer to not complexity it now as it's improvement and not bug fixing.
This isn't working for me. I'm still getting a 404 error after applying the patch.
This does work for me using the second patch.
*** Bug 21088 has been marked as a duplicate of this bug. ***
Created attachment 77413 [details] [review] Bug 21018: Fix TrackClicks for 952$u Caused by commit 51b6cf2aafbfb45b9fcb072403b986fe3c2add53 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>
Created attachment 77414 [details] [review] Bug 21018: Allow uris defined in the item We need to search for uri defined for the itemnumber we passed in parameter. Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
With both patches it works for me as well. I have the 404 for before applying the patch and correct redirects after.
Created attachment 77519 [details] [review] Bug 21018: Fix TrackClicks for 952$u Caused by commit 51b6cf2aafbfb45b9fcb072403b986fe3c2add53 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>
Created attachment 77520 [details] [review] Bug 21018: Allow uris defined in the item 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>
Works well for me and I can't see any regressions.. passes the qa scripts too. Passing QA
Awesome work all! Pushed to master for 18.11
Pushed to 18.05.x for 18.05.03
Pushed to 17.11.x for 17.11.09
Pushed to 17.05.x for 17.05.14