[Bug 27336] New: JS error in Administration › System preferences page
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27336 Bug ID: 27336 Summary: JS error in Administration › System preferences page Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Staff Client Assignee: koha-bugs@lists.koha-community.org Reporter: lucas@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com In the system preference there is a console error when you select the 'Searching' tab or go to: http://localhost:8081/cgi-bin/koha/admin/preferences.pl?tab=searching Uncaught Error: Syntax error, unrecognized expression: #collapse_Did_you_mean/spell_checking -- 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=27336 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |lucas@bywatersolutions.com |ity.org | Severity|enhancement |normal -- 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=27336 --- Comment #1 from Lucas Gass <lucas@bywatersolutions.com> --- Created attachment 114826 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=114826&action=edit Bug 27336: Fix JS error on preferences.pl To test: 1. Go to http://localhost:8081/cgi-bin/koha/admin/preferences.pl?tab=searching 2. If you are on the "Searching" tab you will see a console error 3. Apply patch 4. Make sure the error is gone -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27336 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27336 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|JS error in Administration |JS error in Administration |› System preferences page |- System preferences page -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27336 --- Comment #2 from Lucas Gass <lucas@bywatersolutions.com> --- This error is caused by the line 'Did you mean/spell checking:' in searching.pref The '/' is the problem so I changed the line to 'Did you mean and spell checking' -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27336 David Cook <dcook@prosentient.com.au> 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=27336 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #114826|0 |1 is obsolete| | --- Comment #3 from David Cook <dcook@prosentient.com.au> --- Created attachment 114830 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=114830&action=edit Bug 27336: Fix JS error on preferences.pl To test: 1. Go to http://localhost:8081/cgi-bin/koha/admin/preferences.pl?tab=searching 2. If you are on the "Searching" tab you will see a console error 3. Apply patch 4. Make sure the error is gone Signed-off-by: David Cook <dcook@prosentient.com.au> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27336 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au --- Comment #4 from David Cook <dcook@prosentient.com.au> --- I don't love this solution, since it's more of a workaround than a fix, but it solves the problem. Another solution would've been to further sanitize the ID in preferences.tt but that's also a bit of a pain to do comprehensively. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27336 --- Comment #5 from David Cook <dcook@prosentient.com.au> --- It looks like HTML 4 was strict about the value of ID (https://www.w3.org/TR/html4/types.html#type-id). However, HTML 5 doesn't seem to be (https://www.w3.org/TR/2011/WD-html5-20110525/elements.html#the-id-attribute). It looks like the issue arises in the jquery-2.2.3 library in fa.tokenize. Reading the minified JS even with pretty print turned on is a bit of a nightmare. I feel like Chrome might not be processing things quite right in the debugger. In any case, Jquery and CSS2 get more specific about what they allow and do not allow: https://api.jquery.com/category/selectors/ https://www.w3.org/TR/CSS21/syndata.html#value-def-identifier Wow CSS specs are a bigger mess than one would think... For CSS3... I can't make head or tail of the spec in terms of allowed characters. It says how to escape characters but that's about it (https://www.w3.org/TR/css-syntax-3/#escaping). This is vague: https://www.w3.org/TR/css-syntax-3/#typedef-ident-token "Property names and at-rule names are always identifiers, which have to start with a letter or a hyphen followed by a letter, and then can contain letters, numbers, hyphens, or underscores. You can include any code point at all, even ones that CSS uses in its syntax, by escaping it." https://www.w3.org/TR/css-syntax-3/#syntax-description So I suppose another solution would be to implement a template toolkit for CSS selectors... Anyway, enough of this digression... heh -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27336 --- Comment #6 from Julian Maurice <julian.maurice@biblibre.com> --- Created attachment 114949 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=114949&action=edit Bug 27336 (alternative): Sanitize correctly HTML id Valid characters are alphanumeric characters (a-zA-Z0-9), hyphen (-) and underscore (_) https://www.w3.org/TR/CSS21/syndata.html#value-def-identifier All invalid characters will be replaced by '_' Test plan: 1. Go to Administration » System preferences and click on 'Searching' tab 2. You should see a console error (Uncaught Error: Syntax error, unrecognized expression: #collapse_Did_you_mean/spell_checking) 3. Apply patch 4. Make sure the error is gone 5. prove t/Koha_Template_Plugin_HtmlId.t -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27336 Julian Maurice <julian.maurice@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |julian.maurice@biblibre.com Status|Signed Off |Needs Signoff --- Comment #7 from Julian Maurice <julian.maurice@biblibre.com> --- Instead of working around the bug, let's fix it. Back to needs signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27336 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off Patch complexity|--- |Small patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27336 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #114949|0 |1 is obsolete| | --- Comment #8 from Owen Leonard <oleonard@myacpl.org> --- Created attachment 114952 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=114952&action=edit Bug 27336: (alternative) Sanitize correctly HTML id Valid characters are alphanumeric characters (a-zA-Z0-9), hyphen (-) and underscore (_) https://www.w3.org/TR/CSS21/syndata.html#value-def-identifier All invalid characters will be replaced by '_' Test plan: 1. Go to Administration » System preferences and click on 'Searching' tab 2. You should see a console error (Uncaught Error: Syntax error, unrecognized expression: #collapse_Did_you_mean/spell_checking) 3. Apply patch 4. Make sure the error is gone 5. prove t/Koha_Template_Plugin_HtmlId.t Signed-off-by: Owen Leonard <oleonard@myacpl.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27336 --- Comment #9 from Owen Leonard <oleonard@myacpl.org> --- I think Julian's patch is a better long-term solution. The QA tool will need to be updated to recognize the new filter. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27336 --- Comment #10 from Lucas Gass <lucas@bywatersolutions.com> --- (In reply to Owen Leonard from comment #9)
I think Julian's patch is a better long-term solution. The QA tool will need to be updated to recognize the new filter.
Agreed, and thank you Julian! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27336 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #114830|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=27336 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|lucas@bywatersolutions.com |julian.maurice@biblibre.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27336 Nick Clemens <nick@bywatersolutions.com> 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=27336 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #114952|0 |1 is obsolete| | --- Comment #11 from Nick Clemens <nick@bywatersolutions.com> --- Created attachment 114975 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=114975&action=edit Bug 27336: (alternative) Sanitize correctly HTML id Valid characters are alphanumeric characters (a-zA-Z0-9), hyphen (-) and underscore (_) https://www.w3.org/TR/CSS21/syndata.html#value-def-identifier All invalid characters will be replaced by '_' Test plan: 1. Go to Administration » System preferences and click on 'Searching' tab 2. You should see a console error (Uncaught Error: Syntax error, unrecognized expression: #collapse_Did_you_mean/spell_checking) 3. Apply patch 4. Make sure the error is gone 5. prove t/Koha_Template_Plugin_HtmlId.t Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27336 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #114975|0 |1 is obsolete| | --- Comment #12 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 115006 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=115006&action=edit Bug 27336: Sanitize correctly HTML id Valid characters are alphanumeric characters (a-zA-Z0-9), hyphen (-) and underscore (_) https://www.w3.org/TR/CSS21/syndata.html#value-def-identifier All invalid characters will be replaced by '_' Test plan: 1. Go to Administration » System preferences and click on 'Searching' tab 2. You should see a console error (Uncaught Error: Syntax error, unrecognized expression: #collapse_Did_you_mean/spell_checking) 3. Apply patch 4. Make sure the error is gone 5. prove t/Koha_Template_Plugin_HtmlId.t Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27336 --- Comment #13 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 115007 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=115007&action=edit Bug 27336: Add POD for new package -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27336 --- Comment #14 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 115008 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=115008&action=edit Bug 27336: Fix xt/find-missing-filters.t -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27336 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=27336 --- Comment #15 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=27336 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|21.05.00 |21.05.00,20.11.02 released in| | Status|Pushed to master |Pushed to stable CC| |fridolin.somers@biblibre.co | |m --- Comment #16 from Fridolin Somers <fridolin.somers@biblibre.com> --- Pushed to 20.11.x for 20.11.02 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27336 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |andrew@bywatersolutions.com --- Comment #17 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- I don't see the reported JS error in 20.05. Not backported. Please ask if required. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27336 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.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org