[Bug 27124] New: JS error "select2Width is not defined"
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27124 Bug ID: 27124 Summary: JS error "select2Width is not defined" Change sponsored?: --- Product: Koha Version: unspecified Hardware: All OS: All Status: ASSIGNED Severity: major Priority: P5 - low Component: Templates Assignee: oleonard@myacpl.org Reporter: jonathan.druart@bugs.koha-community.org QA Contact: testopia@bugs.koha-community.org Depends on: 22399 There is a JS error if select2.js is used outside of addbiblio.tt: ReferenceError: select2Width is not defined Edit items view for instance. Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22399 [Bug 22399] Improve responsive behavior of the basic marc editor -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27124 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Version|unspecified |master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27124 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff Patch complexity|--- |Trivial patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27124 --- Comment #1 from Owen Leonard <oleonard@myacpl.org> --- Created attachment 114152 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=114152&action=edit Bug 27124: JS error "select2Width is not defined" This patch changes the way select2.js checks for an existing value of the "select2Width" variable in order to avoid errors when it is undefined. To test, apply the patch and view various pages where the select2 plugin is used: - Basic MARC editor - Items edit - Batch item edit - Authority editor In each case check that the Select2 plugin works correctly to style fields like collection code and home library. On the basic MARC editor page these <select>s should have a width that adjusts as the browser window changes. On other pages the width should be fixed. Check the browser console and confirm that there are no JavaScript errors. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27124 Lucas Gass <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=27124 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #114152|0 |1 is obsolete| | --- Comment #2 from Lucas Gass <lucas@bywatersolutions.com> --- Created attachment 114163 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=114163&action=edit Bug 27124: JS error "select2Width is not defined" This patch changes the way select2.js checks for an existing value of the "select2Width" variable in order to avoid errors when it is undefined. To test, apply the patch and view various pages where the select2 plugin is used: - Basic MARC editor - Items edit - Batch item edit - Authority editor In each case check that the Select2 plugin works correctly to style fields like collection code and home library. On the basic MARC editor page these <select>s should have a width that adjusts as the browser window changes. On other pages the width should be fixed. Check the browser console and confirm that there are no JavaScript errors. 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=27124 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com --- Comment #3 from Lucas Gass <lucas@bywatersolutions.com> --- Seems to fix the console error in all the places! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27124 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |julian.maurice@biblibre.com --- Comment #4 from Julian Maurice <julian.maurice@biblibre.com> --- The use of global variable `select2Width' can be easily avoided here by replacing it by a call to $.fn.select2.defaults.set directly after [% INCLUDE 'select2.inc' %] in addbiblio.tt Is there any benefit using this global variable ? (except for the shorter name) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27124 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #114163|0 |1 is obsolete| | --- Comment #5 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 114236 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=114236&action=edit Bug 27124: JS error "select2Width is not defined" This patch changes the way select2.js checks for an existing value of the "select2Width" variable in order to avoid errors when it is undefined. To test, apply the patch and view various pages where the select2 plugin is used: - Basic MARC editor - Items edit - Batch item edit - Authority editor In each case check that the Select2 plugin works correctly to style fields like collection code and home library. On the basic MARC editor page these <select>s should have a width that adjusts as the browser window changes. On other pages the width should be fixed. Check the browser console and confirm that there are no JavaScript errors. Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27124 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA CC| |martin.renvoize@ptfs-europe | |.com --- Comment #6 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Thanks for the quick fix, works as expected, no regressions found and passes a scripts. Passing QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27124 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |ASSIGNED --- Comment #7 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- There is a pending question at comment 4. Owen, can you answer please? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27124 --- Comment #8 from Owen Leonard <oleonard@myacpl.org> --- (In reply to Jonathan Druart from comment #7)
There is a pending question at comment 4. Owen, can you answer please?
If there is a better way to do it I'm happy for that solution to replace my patch. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27124 --- Comment #9 from Julian Maurice <julian.maurice@biblibre.com> --- (In reply to Owen Leonard from comment #8)
(In reply to Jonathan Druart from comment #7)
There is a pending question at comment 4. Owen, can you answer please?
If there is a better way to do it I'm happy for that solution to replace my patch.
Do you think that the suggested solution in comment 4 is a better solution ? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27124 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #114236|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=27124 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27124 --- Comment #10 from Owen Leonard <oleonard@myacpl.org> --- Created attachment 114300 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=114300&action=edit Bug 27124: JS error "select2Width is not defined" This patch changes the default width paramter passed to the select2 plugin. This allows the basic MARC editor's Select2 widgets to be styled differently than on other pages. To test, apply the patch and view various pages where the select2 plugin is used: - Basic MARC editor - Items edit - Batch item edit - Authority editor In each case check that the Select2 plugin works correctly to style fields like collection code and home library. On the basic MARC editor page these <select>s should have a width that adjusts as the browser window changes. On other pages the width should be fixed. Check the browser console and confirm that there are no JavaScript errors. Update: Thanks to Julian for the suggested optimization -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27124 --- Comment #11 from Owen Leonard <oleonard@myacpl.org> --- (In reply to Julian Maurice from comment #9)
Do you think that the suggested solution in comment 4 is a better solution ?
Yes. I was making an incorrect assumption about when the default had to be set. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27124 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |rel_20_11_candidate -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27124 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |victor@tuxayo.net --- Comment #12 from Victor Grousset/tuxayo <victor@tuxayo.net> --- I tried even though I don't know well these places ^^"
- Basic MARC editor
Is it cataloguing/addbiblio.pl ? Because I don't have the JS error before applying the patch. And I don't field a field that look like a Select2.
- Authority editor
Which field? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27124 Lucas Gass <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=27124 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #114300|0 |1 is obsolete| | --- Comment #13 from Lucas Gass <lucas@bywatersolutions.com> --- Created attachment 114400 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=114400&action=edit Bug 27124: JS error "select2Width is not defined" This patch changes the default width paramter passed to the select2 plugin. This allows the basic MARC editor's Select2 widgets to be styled differently than on other pages. To test, apply the patch and view various pages where the select2 plugin is used: - Basic MARC editor - Items edit - Batch item edit - Authority editor In each case check that the Select2 plugin works correctly to style fields like collection code and home library. On the basic MARC editor page these <select>s should have a width that adjusts as the browser window changes. On other pages the width should be fixed. Check the browser console and confirm that there are no JavaScript errors. Update: Thanks to Julian for the suggested optimization 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=27124 Josef Moravec <josef.moravec@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |josef.moravec@gmail.com --- Comment #14 from Josef Moravec <josef.moravec@gmail.com> --- (In reply to Victor Grousset/tuxayo from comment #12)
I tried even though I don't know well these places ^^"
- Basic MARC editor
Is it cataloguing/addbiblio.pl ? Because I don't have the JS error before applying the patch. And I don't field a field that look like a Select2.
Yes it is addbiblio, on this page the error is not shown, it's the only one page using select2 which does not has this error
- Authority editor
Which field?
I bet you should define some authorized value category to a field manually... I've done it that way, because it was easier to me than trying to find some defined by default (which maybe even don't exist) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27124 Josef Moravec <josef.moravec@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #114400|0 |1 is obsolete| | --- Comment #15 from Josef Moravec <josef.moravec@gmail.com> --- Created attachment 114441 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=114441&action=edit Bug 27124: JS error "select2Width is not defined" This patch changes the default width paramter passed to the select2 plugin. This allows the basic MARC editor's Select2 widgets to be styled differently than on other pages. To test, apply the patch and view various pages where the select2 plugin is used: - Basic MARC editor - Items edit - Batch item edit - Authority editor In each case check that the Select2 plugin works correctly to style fields like collection code and home library. On the basic MARC editor page these <select>s should have a width that adjusts as the browser window changes. On other pages the width should be fixed. Check the browser console and confirm that there are no JavaScript errors. Update: Thanks to Julian for the suggested optimization Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27124 Josef Moravec <josef.moravec@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |josef.moravec@gmail.com |y.org | Status|Signed Off |Passed QA Keywords|rel_20_11_candidate |rel_21_05_candidate --- Comment #16 from Josef Moravec <josef.moravec@gmail.com> --- QA script passed Bug fixed, no regression found -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27124 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |21.05.00 released in| | Status|Passed QA |Pushed to master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27124 --- Comment #17 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Pushed to master for 21.05, thanks to everybody involved! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27124 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m Version(s)|21.05.00 |21.05.00,20.11.01 released in| | Status|Pushed to master |Pushed to stable --- Comment #18 from Fridolin Somers <fridolin.somers@biblibre.com> --- Pushed to 20.11.x for 20.11.01 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27124 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |andrew@bywatersolutions.com --- Comment #19 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Missing dependencies, not backported to 20.05 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27124 Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |caroline.cyr-la-rose@inlibr | |o.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27124 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|rel_21_05_candidate | -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org