[Bug 39307] New: console.error on circ/circulation.pl page
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39307 Bug ID: 39307 Summary: console.error on circ/circulation.pl page Change sponsored?: --- Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: minor Priority: P5 - low Component: Circulation Assignee: koha-bugs@lists.koha-community.org Reporter: lucas@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com, kyle.m.hall@gmail.com To recreate: 1. Navigate to circ/circulation.pl?borrowernumber=X 2. See the console error `document.referrer.split(...)[1] is undefined` -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39307 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39307 --- Comment #1 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Created attachment 179173 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=179173&action=edit 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. APPLY PATCH 4. JS error should be gone -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39307 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Trivial patch Assignee|koha-bugs@lists.koha-commun |lucas@bywatersolutions.com |ity.org | -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39307 Phil Ringnalda <phil@chetcolibrary.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39307 Phil Ringnalda <phil@chetcolibrary.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #179173|0 |1 is obsolete| | --- Comment #2 from Phil Ringnalda <phil@chetcolibrary.org> --- Created attachment 179298 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=179298&action=edit 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. APPLY PATCH 4. JS error should be gone Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39307 Phil Ringnalda <phil@chetcolibrary.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |phil@chetcolibrary.org -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39307 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |37407 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37407 [Bug 37407] Fast add / fast cataloging from patron checkout does not checkout item -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39307 Brendan Lawlor <blawlor@clamsnet.org> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |blawlor@clamsnet.org |y.org | CC| |blawlor@clamsnet.org -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39307 Brendan Lawlor <blawlor@clamsnet.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39307 Brendan Lawlor <blawlor@clamsnet.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #179298|0 |1 is obsolete| | --- Comment #3 from Brendan Lawlor <blawlor@clamsnet.org> --- Created attachment 179638 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=179638&action=edit 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. APPLY PATCH 4. JS error should be gone Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org> Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39307 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Signed Off QA Contact|blawlor@clamsnet.org |testopia@bugs.koha-communit | |y.org Depends on|37407 | CC| |jonathan.druart@gmail.com Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37407 [Bug 37407] Fast add / fast cataloging from patron checkout does not checkout item -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39307 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA Depends on| |37407 QA Contact|testopia@bugs.koha-communit |blawlor@clamsnet.org |y.org | Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37407 [Bug 37407] Fast add / fast cataloging from patron checkout does not checkout item -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39307 --- Comment #4 from Jonathan Druart <jonathan.druart@gmail.com> --- Oops, sorry for the messy changes. Thanks for the fast QA, Brendan! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39307 --- Comment #5 from Brendan Lawlor <blawlor@clamsnet.org> --- Makes sense to check if there is a referrer before running that code block. Passing QA. Thanks! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39307 Eric Phetteplace <ephetteplace@cca.edu> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ephetteplace@cca.edu Status|Passed QA |Failed QA --- Comment #6 from Eric Phetteplace <ephetteplace@cca.edu> --- Unfortunately this fails when 1) there is a referrer and 2) it is not additem.pl. While document.referrer is defined `document.referrer.split(window.location.origin + '/cgi-bin/koha/cataloguing/additem.pl?')[1]` is not be so you'll see an "undefined does not have method match" error. QA plan should be: 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 6. JS error should be gone in both instances -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39307 --- Comment #7 from Eric Phetteplace <ephetteplace@cca.edu> --- This code works since it checks the split array index first before using match: 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(); } } Happy to make a patch and apologies if it's uncouth to set back to failed QA without consulting anyone. I just noticed this console error on our instance and saw that it wasn't due to referrer being undefined but due to the problem I stated above. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39307 --- Comment #8 from Brendan Lawlor <blawlor@clamsnet.org> --- Hi Eric, thanks for catching this and changing to Failed QA. I apologize for not testing thoroughly enough. Your explanation, test plan and code makes sense. If you submit a patch I can test and sign off. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39307 Eric Phetteplace <ephetteplace@cca.edu> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #179638|0 |1 is obsolete| | --- Comment #9 from Eric Phetteplace <ephetteplace@cca.edu> --- Created attachment 179701 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=179701&action=edit 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 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39307 Eric Phetteplace <ephetteplace@cca.edu> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39307 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|lucas@bywatersolutions.com |ephetteplace@cca.edu -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39307 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39307 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #179701|0 |1 is obsolete| | --- Comment #10 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Created attachment 179702 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=179702&action=edit 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> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39307 Brendan Lawlor <blawlor@clamsnet.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39307 Brendan Lawlor <blawlor@clamsnet.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #179702|0 |1 is obsolete| | --- Comment #11 from Brendan Lawlor <blawlor@clamsnet.org> --- Created attachment 179707 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=179707&action=edit 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> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39307 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |25.05.00 released in| | Status|Passed QA |Pushed to main -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39307 --- Comment #12 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Pushed for 25.05! Well done everyone, thank you! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39307 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m Status|Pushed to main |Pushed to stable Version(s)|25.05.00 |25.05.00,24.11.07 released in| | --- Comment #13 from Fridolin Somers <fridolin.somers@biblibre.com> --- Pushed to 24.11.x for 24.11.07 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39307 Bug 39307 depends on bug 37407, which changed state. Bug 37407 Summary: Fast add / fast cataloging from patron checkout does not checkout item https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37407 What |Removed |Added ---------------------------------------------------------------------------- Status|Needs documenting |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39307 Jesse Maseto <jesse@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jesse@bywatersolutions.com --- Comment #14 from Jesse Maseto <jesse@bywatersolutions.com> --- Merge conflicts with 24.05.x Please resolve if needed for this version. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39307 Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to stable |Needs documenting CC| |wainuiwitikapark@catalyst.n | |et.nz --- Comment #15 from Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz> --- Not backporting to 22.11.x as it wasn't backported to 24.05.x -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org