Bugzilla – Attachment 169082 Details for
Bug 37391
QR code for bibliographic record in OPAC should use canonical link
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37391: make QR code for biblio record in OPAC use canonical link
Bug-37391-make-QR-code-for-biblio-record-in-OPAC-u.patch (text/plain), 2.24 KB, created by
Owen Leonard
on 2024-07-17 13:08:49 UTC
(
hide
)
Description:
Bug 37391: make QR code for biblio record in OPAC use canonical link
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2024-07-17 13:08:49 UTC
Size:
2.24 KB
patch
obsolete
>From 3b47d41fa41745106e9880114ed67231487628e1 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Micha=C5=82=20Kula?= > <148193449+mkibp@users.noreply.github.com> >Date: Wed, 17 Jul 2024 11:42:36 +0000 >Subject: [PATCH] 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> >--- > koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >index 7dd44416f5..ef9926d51a 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >@@ -1671,12 +1671,14 @@ > > [% IF ( Koha.Preference('OPACDetailQRCode') ) %] > >+ var link_canonical = document.querySelector("link[rel=canonical]"); >+ > var qrcode = kjua({ > ecLevel: "H", > render: "canvas", > rounded: 100, > size: 150, >- text: location.href, >+ text: link_canonical ? link_canonical.href : location.href, > }); > if (qrcode) { > document.getElementById("qrcode").appendChild( qrcode ); >-- >2.39.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 37391
:
169080
|
169082
|
172992