Bug 37391

Summary: QR code for bibliographic record in OPAC should use canonical link
Product: Koha Reporter: Michał <schodkowy.omegi-0r>
Component: OPACAssignee: Michał <schodkowy.omegi-0r>
Status: RESOLVED FIXED QA Contact: Kyle M Hall (khall) <kyle>
Severity: enhancement    
Priority: P5 - low CC: januszop, kyle, lucas, philip.orr, roman.dolny
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
This patch updates QR code creation from a bibliographic record in the OPAC to use the canonical version of the URL to the bibliographic record, making the shared URL much shorter and the created QR code less complicated. Note that the system preference OPACDetailQRCode must be set to 'Enable' in order to show the QR code in the bibliographic record's detail page in the OPAC.
Version(s) released in:
24.11.00
Circulation function:
Bug Depends on: 35812    
Bug Blocks:    
Attachments: Bug 37391: make QR code for biblio record in OPAC use canonical link
Bug 37391: make QR code for biblio record in OPAC use canonical link
Bug 37391: make QR code for biblio record in OPAC use canonical link

Description Michał 2024-07-17 11:32:46 UTC
In /opac-detail.pl page there's an option to show a QR code to open up said record on your phone or share it with others in such a way.

Currently, it simply uses the current `location.href` of the browser. This isn't ideal, because such URL can be much longer, resulting in more complex/harder to scan QR code, plus URL parameters can contain extra junk, such as our previous search query that led us to current record, which we might not necessarily want to share.

Thus, now having simple canonical URLs after the "Depends On" patch was merged in, we can replace these QR codes to link to them instead.

Example old URL: https://koha.example.com/cgi-bin/koha/
opac-detail.pl?biblionumber=12345&query_desc=test
Example new URL: https://koha.example.com/bib/12345
Comment 1 Michał 2024-07-17 11:43:07 UTC
Created attachment 169080 [details] [review]
Bug 37391: make QR code for biblio record in OPAC use canonical link

In /opac-detail.pl page there's an option to show a QR code to open up said record on your phone or share it with others in such a way.

Currently, it simply uses the current `location.href` of the browser. This isn't ideal, because such URL can be much longer, resulting in more complex/harder to scan QR code, plus URL parameters can contain extra junk, such as our previous search query that led us to current record, which we might not necessarily want to share.

Thus, now having simple canonical URLs after the "Depends On" patch was merged in, we can replace these QR codes to link to them instead.

To test:
1. Visit biblio detail page in OPAC
2. Click the button to show QR code in the right pane (preference 'OPACDetailQRCode' must be enabled)
3. Notice that the QR code is much simpler/less complex now
4. Scan the QR code with your phone and confirm it's in the desired format of <URL>/bib/123 and that it opens up properly
Comment 2 Owen Leonard 2024-07-17 13:08:49 UTC
Created attachment 169082 [details] [review]
Bug 37391: make QR code for biblio record in OPAC use canonical link

In /opac-detail.pl page there's an option to show a QR code to open up
said record on your phone or share it with others in such a way.

Currently, it simply uses the current `location.href` of the browser.
This isn't ideal, because such URL can be much longer, resulting in
more complex/harder to scan QR code, plus URL parameters can contain
extra junk, such as our previous search query that led us to current
record, which we might not necessarily want to share.

Thus, now having simple canonical URLs after the "Depends On" patch was
merged in, we can replace these QR codes to link to them instead.

To test:
1. Visit biblio detail page in OPAC
2. Click the button to show QR code in the right pane (preference
   'OPACDetailQRCode' must be enabled)
3. Notice that the QR code is much simpler/less complex now
4. Scan the QR code with your phone and confirm it's in the desired
   format of <URL>/bib/123 and that it opens up properly

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 3 Kyle M Hall (khall) 2024-10-18 18:07:04 UTC
Created attachment 172992 [details] [review]
Bug 37391: make QR code for biblio record in OPAC use canonical link

In /opac-detail.pl page there's an option to show a QR code to open up
said record on your phone or share it with others in such a way.

Currently, it simply uses the current `location.href` of the browser.
This isn't ideal, because such URL can be much longer, resulting in
more complex/harder to scan QR code, plus URL parameters can contain
extra junk, such as our previous search query that led us to current
record, which we might not necessarily want to share.

Thus, now having simple canonical URLs after the "Depends On" patch was
merged in, we can replace these QR codes to link to them instead.

To test:
1. Visit biblio detail page in OPAC
2. Click the button to show QR code in the right pane (preference
   'OPACDetailQRCode' must be enabled)
3. Notice that the QR code is much simpler/less complex now
4. Scan the QR code with your phone and confirm it's in the desired
   format of <URL>/bib/123 and that it opens up properly

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 4 Katrin Fischer 2024-10-24 14:56:59 UTC
Pushed for 24.11!

Well done everyone, thank you!
Comment 5 Philip Orr 2024-11-08 15:23:58 UTC
Added release notes
Comment 6 Lucas Gass (lukeg) 2024-11-18 23:05:20 UTC
Enhancement, no 24.05.x backport