[Bug 42781] New: Declare 'name' before using it in patron-format.js
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42781 Bug ID: 42781 Summary: Declare 'name' before using it in patron-format.js Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: trivial Priority: P5 - low Component: Patrons Assignee: koha-bugs@lists.koha-community.org Reporter: magnus@libriotech.no QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com, kyle@bywatersolutions.com The JS in patron-format.js uses a variable called "name" without declaring it first. Looks like "var name" was removed in this patch: https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=188806 (thanks to Joubu for spotting that.) We should restore it. Dicussion: https://chat.koha-community.org/koha-community/pl/56eb7shuifbu8q7s1sarwkjawa -- 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=42781 Magnus Enger <magnus@libriotech.no> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |magnus@libriotech.no |ity.org | Status|NEW |Needs Signoff Patch complexity|--- |Trivial patch -- 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=42781 --- Comment #1 from Magnus Enger <magnus@libriotech.no> --- Created attachment 200045 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200045&action=edit Bug 42781: Declare 'name' before using it in patron-format.js The code in koha-tmpl/intranet-tmpl/prog/js/patron-format.js uses a variable called 'name' without declaring it first. The declaration was removed in bug 32176. No deterioration of functionality has been discovered in connection with this, but the declaration should be restored. To test: - Apply the patch. - HidePatronName = Show - Look at the staff detail view for a record that has at least one item on loan. - Verify the name of the patron is displayed as expected. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42781 Jonathan Druart <jonathan.druart@gmail.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=42781 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #200045|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42781 --- Comment #2 from Jonathan Druart <jonathan.druart@gmail.com> --- Created attachment 200047 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200047&action=edit Bug 42781: Declare 'name' before using it in patron-format.js The code in koha-tmpl/intranet-tmpl/prog/js/patron-format.js uses a variable called 'name' without declaring it first. The declaration was removed in bug 32176. No deterioration of functionality has been discovered in connection with this, but the declaration should be restored. To test: - Apply the patch. - HidePatronName = Show - Look at the staff detail view for a record that has at least one item on loan. - Verify the name of the patron is displayed as expected. Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42781 --- Comment #3 from Jonathan Druart <jonathan.druart@gmail.com> --- Created attachment 200447 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200447&action=edit Bug 42781: Do not modify window.name https://developer.mozilla.org/en-US/docs/Web/API/Window/name Test plan: 0. Do not apply this patch (you can apply the first one) 1. Go to /cgi-bin/koha/members/members-home.pl 2. Open the console 3. type "window.name", it's "" 4. Run a patron search, "d" 5. window.name is now "Duffy, Joann name" 6. Apply this patch, try again 7. window.name is still an empty string -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42781 Jan Kissig <bibliothek@th-wildau.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bibliothek@th-wildau.de QA Contact|testopia@bugs.koha-communit |bibliothek@th-wildau.de |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42781 Jan Kissig <bibliothek@th-wildau.de> 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=42781 Jan Kissig <bibliothek@th-wildau.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #200047|0 |1 is obsolete| | Attachment #200447|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42781 --- Comment #4 from Jan Kissig <bibliothek@th-wildau.de> --- Created attachment 200450 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200450&action=edit Bug 42781: Declare 'name' before using it in patron-format.js The code in koha-tmpl/intranet-tmpl/prog/js/patron-format.js uses a variable called 'name' without declaring it first. The declaration was removed in bug 32176. No deterioration of functionality has been discovered in connection with this, but the declaration should be restored. To test: - Apply the patch. - HidePatronName = Show - Look at the staff detail view for a record that has at least one item on loan. - Verify the name of the patron is displayed as expected. Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Jan Kissig <bibliothek@th-wildau.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42781 --- Comment #5 from Jan Kissig <bibliothek@th-wildau.de> --- Created attachment 200451 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=200451&action=edit Bug 42781: Do not modify window.name https://developer.mozilla.org/en-US/docs/Web/API/Window/name Test plan: 0. Do not apply this patch (you can apply the first one) 1. Go to /cgi-bin/koha/members/members-home.pl 2. Open the console 3. type "window.name", it's "" 4. Run a patron search, "d" 5. window.name is now "Duffy, Joann name" 6. Apply this patch, try again 7. window.name is still an empty string Signed-off-by: Jan Kissig <bibliothek@th-wildau.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42781 --- Comment #6 from Jan Kissig <bibliothek@th-wildau.de> --- Though I could not verify the pollution of window.name from Jonathans comment (https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42781#c3) as it seems my browser is resetting window.name properly, the patches work as described. The variable name is not declared globally anymore. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42781 Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |26.11.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=42781 --- Comment #7 from Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> --- Thanks everyone! Pushed to main for 26.11! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42781 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|26.11.00 |26.11.00,26.05.01 released in| | Status|Pushed to main |Pushed to stable -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42781 --- Comment #8 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Nice work everyone! Pushed to 26.05.x for the upcoming 26.05.01 release. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org