[Bug 36235] New: System preferences chopping everything after a semicolon.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36235 Bug ID: 36235 Summary: System preferences chopping everything after a semicolon. Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: critical Priority: P5 - low Component: System Administration Assignee: koha-bugs@lists.koha-community.org Reporter: lucas@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com I noticed this with IntranetUserJS. To recreate: 1. Add some JS that includes a semicolon to IntranetUserJS: $(document).ready(function() { let my_old_cat = $('#categorycode_entry').val(); console.log(my_old_cat); $('#categorycode_entry').on('change' , function() { let my_new_cat = $('#categorycode_entry').val(); console.log( my_old_cat ); console.log( my_new_cat ); }); }); 2. Save and reload, or check in DB and you'll see this value: $(document).ready(function() { let my_old_cat = $('#categorycode_entry').val() To see in DB you can use: select value from systempreferences where variable = 'IntranetUserJS'; -- 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=36235 --- Comment #1 from Lucas Gass <lucas@bywatersolutions.com> --- This doesn't effect only CodeMirror system preference but all that allow free text: I tested with AdditionalFieldsInZ3950ResultAuthSearch -- 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=36235 --- Comment #2 from Jonathan Druart <jonathan.druart@gmail.com> --- diff --git a/koha-tmpl/intranet-tmpl/prog/js/fetch/system-preferences-api-client.js b/koha-tmpl/intranet-tmpl/prog/js/fetch/system-preferences-api-client.js index 1b8634951b6..e2b9bcbac8a 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/fetch/system-preferences-api-client.js +++ b/koha-tmpl/intranet-tmpl/prog/js/fetch/system-preferences-api-client.js @@ -32,7 +32,7 @@ export class SysprefAPIClient extends HttpClient { .map(variable => sysprefs[variable].length ? sysprefs[variable].map(value => - "%s=%s".format(variable, value) + "%s=%s".format(variable, encodeURIComponent(value)) ) : "%s=".format(variable) ) -- 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=36235 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |36084 CC| |jonathan.druart@gmail.com Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36084 [Bug 36084] Pass CSRF token to SVC scripts (1/2) -- 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=36235 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |lucas@bywatersolutions.com |ity.org | 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=36235 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=36235 --- Comment #3 from Lucas Gass <lucas@bywatersolutions.com> --- Created attachment 162778 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=162778&action=edit Bug 36235: Encode system preference data with encodeURIComponent To test: 1. Add some data to a freetext system preference like IntranetUserJS or AdditionalFieldsInZ3950ResultAuthSearch that includes a semicolon; 2. Save the pref and reload the page or check the DB. Everything after the semicolon is removed. 3. Apply patch, try again. Data should remain as is. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36235 --- Comment #4 from Lucas Gass <lucas@bywatersolutions.com> --- I just converted Jonathan's diff into a patch. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36235 --- Comment #5 from Jonathan Druart <jonathan.druart@gmail.com> --- (In reply to Lucas Gass from comment #4)
I just converted Jonathan's diff into a patch.
Did it fix your problem? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36235 --- Comment #6 from Lucas Gass <lucas@bywatersolutions.com> --- (In reply to Jonathan Druart from comment #5)
(In reply to Lucas Gass from comment #4)
I just converted Jonathan's diff into a patch.
Did it fix your problem?
Yes. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36235 Pedro Amorim <pedro.amorim@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #162778|0 |1 is obsolete| | --- Comment #7 from Pedro Amorim <pedro.amorim@ptfs-europe.com> --- Created attachment 162975 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=162975&action=edit Bug 36235: Encode system preference data with encodeURIComponent To test: 1. Add some data to a freetext system preference like IntranetUserJS or AdditionalFieldsInZ3950ResultAuthSearch that includes a semicolon; 2. Save the pref and reload the page or check the DB. Everything after the semicolon is removed. 3. Apply patch, try again. Data should remain as is. Signed-off-by: Pedro Amorim <pedro.amorim@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=36235 Pedro Amorim <pedro.amorim@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com, | |katrin.fischer@bsz-bw.de, | |martin.renvoize@ptfs-europe | |.com, | |pedro.amorim@ptfs-europe.co | |m Keywords| |regression Severity|critical |blocker --- Comment #8 from Pedro Amorim <pedro.amorim@ptfs-europe.com> --- I stumbled upon this by chance while copying intranetuserjs from a live environment to my own local test environment. This should be QAd and/or pushed asap. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36235 Pedro Amorim <pedro.amorim@ptfs-europe.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=36235 Laura Escamilla <Laura.escamilla@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |Laura.escamilla@bywatersolu | |tions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36235 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #162975|0 |1 is obsolete| | --- Comment #9 from David Nind <david@davidnind.com> --- Created attachment 163011 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=163011&action=edit Bug 36235: Encode system preference data with encodeURIComponent To test: 1. Add some data to a freetext system preference like IntranetUserJS or AdditionalFieldsInZ3950ResultAuthSearch that includes a semicolon; 2. Save the pref and reload the page or check the DB. Everything after the semicolon is removed. 3. Apply patch, try again. Data should remain as is. Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com> Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36235 --- Comment #10 from David Nind <david@davidnind.com> --- Adding my sign off as well, in case that will help with QA. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36235 Jonathan Druart <jonathan.druart@gmail.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=36235 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #163011|0 |1 is obsolete| | --- Comment #11 from Jonathan Druart <jonathan.druart@gmail.com> --- Created attachment 163026 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=163026&action=edit Bug 36235: Encode system preference data with encodeURIComponent To test: 1. Add some data to a freetext system preference like IntranetUserJS or AdditionalFieldsInZ3950ResultAuthSearch that includes a semicolon; 2. Save the pref and reload the page or check the DB. Everything after the semicolon is removed. 3. Apply patch, try again. Data should remain as is. Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com> Signed-off-by: David Nind <david@davidnind.com> 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=36235 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |24.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=36235 --- Comment #12 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Pushed for 24.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=36235 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m --- Comment #13 from Fridolin Somers <fridolin.somers@biblibre.com> --- Bug 36084 is not in 23.11.x but looks like this can be backported ? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36235 --- Comment #14 from Pedro Amorim <pedro.amorim@ptfs-europe.com> --- (In reply to Fridolin Somers from comment #13)
Bug 36084 is not in 23.11.x but looks like this can be backported ?
I don't think so. koha-tmpl/intranet-tmpl/prog/js/vue/fetch/system-preferences-api-client.js does not exist in 23,11,x -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36235 --- Comment #15 from Fridolin Somers <fridolin.somers@biblibre.com> --- (In reply to Pedro Amorim from comment #14)
(In reply to Fridolin Somers from comment #13)
Bug 36084 is not in 23.11.x but looks like this can be backported ?
I don't think so. koha-tmpl/intranet-tmpl/prog/js/vue/fetch/system-preferences-api-client.js does not exist in 23,11,x
Yes it exists, since Bug 33289 https://git.koha-community.org/Koha-community/Koha/src/branch/23.11.x/koha-t... -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36235 --- Comment #16 from Jonathan Druart <jonathan.druart@gmail.com> --- The *vue* file exists, not koha-tmpl/intranet-tmpl/prog/js/fetch/system-preferences-api-client.js ! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36235 --- Comment #17 from Pedro Amorim <pedro.amorim@ptfs-europe.com> --- Correct, we now have: koha-tmpl/intranet-tmpl/prog/js/vue/fetch/system-preferences-api-client.js koha-tmpl/intranet-tmpl/prog/js/fetch/system-preferences-api-client.js This is not great, for many reasons, one of which highlighted just now (it's confusing and redundant). -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36235 --- Comment #18 from Jonathan Druart <jonathan.druart@gmail.com> --- (In reply to Pedro Amorim from comment #17)
Correct, we now have: koha-tmpl/intranet-tmpl/prog/js/vue/fetch/system-preferences-api-client.js koha-tmpl/intranet-tmpl/prog/js/fetch/system-preferences-api-client.js
This is not great, for many reasons, one of which highlighted just now (it's confusing and redundant).
As said in other places, I have ofc tried to avoid that but failed. Suggestions are more than welcome! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36235 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to master |RESOLVED Resolution|--- |FIXED --- Comment #19 from Fridolin Somers <fridolin.somers@biblibre.com> --- (In reply to Pedro Amorim from comment #17)
Correct, we now have: koha-tmpl/intranet-tmpl/prog/js/vue/fetch/system-preferences-api-client.js koha-tmpl/intranet-tmpl/prog/js/fetch/system-preferences-api-client.js
This is not great, for many reasons, one of which highlighted just now (it's confusing and redundant).
Ooohhhh. I need coffee ;) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36235 Bug 36235 depends on bug 36084, which changed state. Bug 36084 Summary: Pass CSRF token to SVC scripts (1/2) https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36084 What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to master |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org