Bug 27979 - Multiple item URIs break redirect if TrackClicks enabled
Summary: Multiple item URIs break redirect if TrackClicks enabled
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Aleisha Amohia
QA Contact: Marcel de Rooy
URL:
Keywords:
Depends on:
Blocks: 27961
  Show dependency treegraph
 
Reported: 2021-03-17 20:38 UTC by Aleisha Amohia
Modified: 2021-04-25 20:45 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Text to go in the release notes:
Version(s) released in:
21.05.00,20.11.05,20.05.11


Attachments
Bug 27979: Modify TrackClicks to verify URL exists in DB when multiple uri (1.73 KB, patch)
2021-03-17 20:43 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 27979: Modify TrackClicks to verify URL exists in DB when multiple uri (1.78 KB, patch)
2021-04-01 19:24 UTC, David Nind
Details | Diff | Splinter Review
Bug 27979: Modify TrackClicks to verify URL exists in DB when multiple uri (1.88 KB, patch)
2021-04-16 06:48 UTC, Marcel de Rooy
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Aleisha Amohia 2021-03-17 20:38:01 UTC
You can add multiple URLs in the items.uri field by separating them with " | ". However if you also have the TrackClicks system preference enabled, the script is incorrectly verifying if the URL exists in the database.
Comment 1 Aleisha Amohia 2021-03-17 20:43:57 UTC
Created attachment 118448 [details] [review]
Bug 27979: Modify TrackClicks to verify URL exists in DB when multiple uri

To test:
1) Go to Admin -> system preferences and enable the TrackClicks syspref
(set to Track or Track anonymously)
2) Find a record in the staff client with an item. Edit the item and put
two external URLs in the Uniform Resource Identifier field, e.g.
"https://www.google.com/ | https://twitter.com/"
3) Search for that record in the OPAC. Notice the two links in the
holdings table.
4) Click a link and confirm that you are directed to a 404.
5) Apply the patch and refresh the page
6) Click a link and confirm that you are directed to the page as
expected
7) Go back to edit the record in the staff client and remove one of the
links from the URI field
8) Go back to the OPAC and confirm you can still access the link as
expected when there is only one URI

Sponsored-by: Catalyst IT
Comment 2 David Nind 2021-04-01 19:24:19 UTC
Created attachment 119088 [details] [review]
Bug 27979: Modify TrackClicks to verify URL exists in DB when multiple uri

To test:
1) Go to Admin -> system preferences and enable the TrackClicks syspref
(set to Track or Track anonymously)
2) Find a record in the staff client with an item. Edit the item and put
two external URLs in the Uniform Resource Identifier field, e.g.
"https://www.google.com/ | https://twitter.com/"
3) Search for that record in the OPAC. Notice the two links in the
holdings table.
4) Click a link and confirm that you are directed to a 404.
5) Apply the patch and refresh the page
6) Click a link and confirm that you are directed to the page as
expected
7) Go back to edit the record in the staff client and remove one of the
links from the URI field
8) Go back to the OPAC and confirm you can still access the link as
expected when there is only one URI

Sponsored-by: Catalyst IT

Signed-off-by: David Nind <david@davidnind.com>
Comment 3 Marcel de Rooy 2021-04-16 06:21:54 UTC
QAing
Comment 4 Marcel de Rooy 2021-04-16 06:48:02 UTC
Created attachment 119693 [details] [review]
Bug 27979: Modify TrackClicks to verify URL exists in DB when multiple uri

To test:
1) Go to Admin -> system preferences and enable the TrackClicks syspref
(set to Track or Track anonymously)
2) Find a record in the staff client with an item. Edit the item and put
two external URLs in the Uniform Resource Identifier field, e.g.
"https://www.google.com/ | https://twitter.com/"
3) Search for that record in the OPAC. Notice the two links in the
holdings table.
4) Click a link and confirm that you are directed to a 404.
5) Apply the patch and refresh the page
6) Click a link and confirm that you are directed to the page as
expected
7) Go back to edit the record in the staff client and remove one of the
links from the URI field
8) Go back to the OPAC and confirm you can still access the link as
expected when there is only one URI

Sponsored-by: Catalyst IT

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 5 Jonathan Druart 2021-04-16 10:29:50 UTC
Pushed to master for 21.05, thanks to everybody involved!
Comment 6 Fridolin Somers 2021-04-22 14:18:50 UTC
Pushed to 20.11.x for 20.11.05
Comment 7 Andrew Fuerste-Henry 2021-04-25 16:32:07 UTC
Pushed to 20.05.x for 20.05.11
Comment 8 Victor Grousset/tuxayo 2021-04-25 20:45:11 UTC
Not backported to oldoldstable (19.11.x). Feel free to ask if it's needed.