Bug 39088 - If OPACURLOpenInNewWindow is enabled, URLs without http are broken in OPAC results
Summary: If OPACURLOpenInNewWindow is enabled, URLs without http are broken in OPAC re...
Status: Pushed to main
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Jonathan Druart
QA Contact: Marcel de Rooy
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-02-10 22:27 UTC by Caroline Cyr La Rose
Modified: 2025-02-17 14:07 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
25.05.00
Circulation function:


Attachments
Record to test (3.51 KB, text/plain)
2025-02-10 22:27 UTC, Caroline Cyr La Rose
Details
Bug 39088: Correctly prefix url with protocol when OPACURLOpenInNewWindow on the OPAC result page (2.07 KB, patch)
2025-02-11 12:41 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 39088: Correctly prefix url with protocol when OPACURLOpenInNewWindow on the OPAC result page (2.13 KB, patch)
2025-02-11 14:12 UTC, Caroline Cyr La Rose
Details | Diff | Splinter Review
Bug 39088: Correctly prefix url with protocol when OPACURLOpenInNewWindow on the OPAC result page (2.23 KB, patch)
2025-02-14 09:06 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 Caroline Cyr La Rose 2025-02-10 22:27:22 UTC
Created attachment 177713 [details]
Record to test

A client reported this and I was able to recreate on main. They have 800+ records with URLs in 856$u without the https:// at the beginning. The URLs open fine everywhere *except* the OPAC results, where the OPACBaseURL is somehow prepended to the URL in 856. If we turn off OPACURLOpenInNewWindow, the links work fine in OPAC results.

I attached one of their records as an example.

To test:
1. Import the attached record
   1.1. Go to Cataloging > Stage records for import
   1.2. Choose the file
   1.3. Click on 'Upload file'
   1.4. Click on 'Stage for import'
   1.5. Click 'View batch'
   1.6. Click 'Import this batch into the catalog'

2. In the staff interface, search for 'Statistics'

3. In the search results, hover over 'View Document - English' under the title 'Technology adoption by women-owned businesses in Canada'
   --> URL is publication.gc.ca... (OK)

4. Click on the title to access the detailed record

5. Hover over 'View Document - English'
   --> URL is publication.gc.ca... (OK)

6. In the OPAC, search for 'Statistics'

7. In the search results, hover over 'View Document - English' under the title 'Technology adoption by women-owned businesses in Canada'
   --> URL is publication.gc.ca... (OK)

8. Click on the title to access the detailed record

9. Hover over 'View Document - English'
   --> URL is publication.gc.ca... (OK)

10. Enable OPACURLOpenInNewWindow
    10.1. Go to Administration > System preferences
    10.2. Search for OPACURLOpenInNewWindow
    10.3. Change the value to 'do'
    10.4. Click 'Save all OPAC preferences'

11. Redo steps 2-9
    staff interface search results = OK
    staff interface detailed record = OK
    OPAC search results = URL is localhost:8080/cgi-bin/koha/publications.gc.ca (NOT OK)
    OPAC detailed record = OK
Comment 1 Jonathan Druart 2025-02-11 12:41:04 UTC
Created attachment 177729 [details] [review]
Bug 39088: Correctly prefix url with protocol when OPACURLOpenInNewWindow on the OPAC result page

There is certainly something better to do as the xsl for the OPACDetail
is calling it only once, but it needs more work.
Comment 2 Caroline Cyr La Rose 2025-02-11 14:12:09 UTC
Created attachment 177734 [details] [review]
Bug 39088: Correctly prefix url with protocol when OPACURLOpenInNewWindow on the OPAC result page

There is certainly something better to do as the xsl for the OPACDetail
is calling it only once, but it needs more work.

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Comment 3 Marcel de Rooy 2025-02-14 09:06:52 UTC
Created attachment 178089 [details] [review]
Bug 39088: Correctly prefix url with protocol when OPACURLOpenInNewWindow on the OPAC result page

There is certainly something better to do as the xsl for the OPACDetail
is calling it only once, but it needs more work.

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 4 Katrin Fischer 2025-02-17 14:07:31 UTC
Pushed for 25.05!

Well done everyone, thank you!