Bugzilla – Attachment 179707 Details for
Bug 39307
console.error on circ/circulation.pl page
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 39307: Check to make sure there is a document.referrer
Bug-39307-Check-to-make-sure-there-is-a-documentre.patch (text/plain), 2.31 KB, created by
Brendan Lawlor
on 2025-03-25 20:48:05 UTC
(
hide
)
Description:
Bug 39307: Check to make sure there is a document.referrer
Filename:
MIME Type:
Creator:
Brendan Lawlor
Created:
2025-03-25 20:48:05 UTC
Size:
2.31 KB
patch
obsolete
>From 7a494ca6de9780d6430870fd5b3b0645ef0908b4 Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Tue, 11 Mar 2025 16:53:28 +0000 >Subject: [PATCH] Bug 39307: Check to make sure there is a document.referrer > >To test: >1. Navigate to circ/circulation.pl?borrowernumber=X >2. See the console error `document.referrer.split(...)[1] is undefined` >3. Go to circ home circ/circulation-home.pl and search for a patron >4. See the console error when you select a patron or are taken directly to them >5. APPLY PATCH >5. JS error should be gone in both instances > >squash > >Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> >Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> >--- > .../prog/en/modules/circ/circulation.tt | 14 ++++++++------ > 1 file changed, 8 insertions(+), 6 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >index d81f3522f6..ad2dcc6412 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >@@ -1210,13 +1210,15 @@ > > // Handle checkout for fast cataloging > // Check the referrer to prevent csrf, fill and submit form >- if(document.referrer.split(window.location.origin + '/cgi-bin/koha/cataloguing/additem.pl?')[1].match(/frameworkcode=FA&circborrowernumber=/) ) { >- let urlParams = new URLSearchParams(window.location.search); >- let barcode = urlParams.get('barcode'); >- $('#barcode').val(barcode); >- $('#mainform').submit(); >+ if (document.referrer.length) { >+ const referrerSplit = document.referrer.split(window.location.origin + '/cgi-bin/koha/cataloguing/additem.pl?') >+ if(referrerSplit[1] && referrerSplit[1].match(/frameworkcode=FA&circborrowernumber=/) ) { >+ let urlParams = new URLSearchParams(window.location.search); >+ let barcode = urlParams.get('barcode'); >+ $('#barcode').val(barcode); >+ $('#mainform').submit(); >+ } > } >- > $("#cancellation-reason").comboBox({ > displayProperty: 'name', > placeholder: _("Select or type a reason"), >-- >2.39.5
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 39307
:
179173
|
179298
|
179638
|
179701
|
179702
| 179707