[Bug 11707] New: Additional attributes broken for category code with space
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11707 Bug ID: 11707 Summary: Additional attributes broken for category code with space Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Patrons Assignee: koha-bugs@lists.koha-community.org Reporter: fridolyn.somers@biblibre.com QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com, kyle.m.hall@gmail.com When editing additional attributes of a patron of a category with a code with space (ie "CAT 3"), the Javascript is broken and Additional attributes are not displayed. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11707 Fridolin SOMERS <fridolyn.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- 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.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11707 --- Comment #1 from Fridolin SOMERS <fridolyn.somers@biblibre.com> --- Created attachment 25113 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=25113&action=edit Bug 11707 - Additional attributes broken for category code with space When editing additional attributes of a patron of a category with a code with space (ie "CAT 3"), the Javascript is broken and Additional attributes are not displayed. This patch corrects by adding simple quotes aroud category code in JS code. Test plan : - Create an patron additional attribute - Create a new patron category with a space in code. ie "CAT 3" - Create a new patron of this category : /cgi-bin/koha/members/memberentry.pl?op=add&categorycode=CAT 3 => Without patch the JS is broken (Syntax error, unrecognized expression: [data-category_code=CAT 3]) and additional attributes are not displayed. => With patch the JS is not broken and additional attributes are displayed and can be edited. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11707 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |katrin.fischer@bsz-bw.de --- Comment #2 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- I am not against fixing this, but in general I would never recommend using codes with spaces in them. This is probably not the only problem. Joy wrote something about it a while ago: http://bywatersolutions.com/2012/07/05/naming-conventions-in-koha/ -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11707 --- Comment #3 from Marc Véron <veron@veron.ch> --- Created attachment 25301 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=25301&action=edit [SIGNED-OFF] Bug 11707 - Additional attributes broken for category code with space When editing additional attributes of a patron of a category with a code with space (ie "CAT 3"), the Javascript is broken and Additional attributes are not displayed. This patch corrects by adding simple quotes aroud category code in JS code. Test plan : - Create an patron additional attribute - Create a new patron category with a space in code. ie "CAT 3" - Create a new patron of this category : /cgi-bin/koha/members/memberentry.pl?op=add&categorycode=CAT 3 => Without patch the JS is broken (Syntax error, unrecognized expression: [data-category_code=CAT 3]) and additional attributes are not displayed. => With patch the JS is not broken and additional attributes are displayed and can be edited. In current Koha version it is not possible to create categroy codes with blanks. To test, I changed an existing category code directly in the database. Then I followed the Test plan. Without patch, attribute types were not displayed. With patch, they were displayed as expected. Signed-off-by: Marc Véron <veron@veron.ch> -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11707 Marc Véron <veron@veron.ch> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #25113|0 |1 is obsolete| | CC| |veron@veron.ch -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11707 Marc Véron <veron@veron.ch> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11707 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@biblibre.co | |m Assignee|koha-bugs@lists.koha-commun |fridolyn.somers@biblibre.co |ity.org |m -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11707 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Needs Signoff CC| |kyle@bywatersolutions.com --- Comment #4 from Kyle M Hall <kyle@bywatersolutions.com> --- I agree with Katrin's comment. Perhaps it would be better to fix this by adding a check to the attribute creator to stop a librarian from creating an attribute with a space in the value, and perhaps some of Joy's other recommendations. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11707 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11707 --- Comment #5 from Jonathan Druart <jonathan.druart@biblibre.com> --- (In reply to Kyle M Hall from comment #4)
I agree with Katrin's comment. Perhaps it would be better to fix this by adding a check to the attribute creator to stop a librarian from creating an attribute with a space in the value, and perhaps some of Joy's other recommendations.
I agree too, but what about existing ones? :) -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11707 --- Comment #6 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- I think I would strongly encourage the library to switch to patron category codes without spaces :) -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11707 --- Comment #7 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Btw, Koha currently does not let you enter a patron category code with a space and shows an error message if you try: category code can only contain the following characters: letters, numbers, - and -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11707 --- Comment #8 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 25567 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=25567&action=edit [PASSED QA] Bug 11707 - Additional attributes broken for category code with space When editing additional attributes of a patron of a category with a code with space (ie "CAT 3"), the Javascript is broken and Additional attributes are not displayed. This patch corrects by adding simple quotes aroud category code in JS code. Test plan : - Create an patron additional attribute - Create a new patron category with a space in code. ie "CAT 3" - Create a new patron of this category : /cgi-bin/koha/members/memberentry.pl?op=add&categorycode=CAT 3 => Without patch the JS is broken (Syntax error, unrecognized expression: [data-category_code=CAT 3]) and additional attributes are not displayed. => With patch the JS is not broken and additional attributes are displayed and can be edited. In current Koha version it is not possible to create categroy codes with blanks. To test, I changed an existing category code directly in the database. Then I followed the Test plan. Without patch, attribute types were not displayed. With patch, they were displayed as expected. Signed-off-by: Marc Véron <veron@veron.ch> Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> I recommend not using codes with spaces and fix existing ones. Koha doesn't allow you to add category codes with spaces, so the only way to do it is via SQL. This patch fixes a problem and passes all tests. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11707 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA Patch complexity|Trivial patch |Small patch -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11707 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #25301|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11707 Galen Charlton <gmcharlt@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master --- Comment #9 from Galen Charlton <gmcharlt@gmail.com> --- Pushed to master. Thanks, Fridolin! -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11707 Fridolin SOMERS <fridolyn.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|Small patch |Trivial patch -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11707 Fridolin SOMERS <fridolyn.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|Trivial patch |Small patch -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11707 Fridolin SOMERS <fridolyn.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |Pushed to Stable --- Comment #10 from Fridolin SOMERS <fridolyn.somers@biblibre.com> --- Pushed to 3.14.x, will be in 3.14.07 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11707 --- Comment #11 from Kyle M Hall <kyle@bywatersolutions.com> --- Pushed to 3.12.x will be in 3.12.13 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org