[Bug 17098] New: Validation problems with form field type "number" ( decimal separator)
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17098 Bug ID: 17098 Summary: Validation problems with form field type "number" (decimal separator) Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: gmcharlt@gmail.com Reporter: veron@veron.ch QA Contact: testopia@bugs.koha-community.org With Koha language set to de-DE, it is not possible to enter numeric values with decimal separator point like 5.00 if the input field is of type "numeric". Validation requires comma (,) Independently on Koha language and CurrencyFormat settings, you get an error message (in German): "Bitte geben Sie eine Nummer ein." To verify: - Install language de-DE (alternatively use Firebug to manipulate page HTML to <html lang="de-DE"> or to set lang="de-DE directly in form field). - Go to /cgi-bin/koha/members/maninvoice.pl?borrowernumber=XXX ("Manuelle Gebühr") - In field "Betrag:", enter 5.00 Result: Field border turns to red, field shows tooltip "Bitte geben Sie eine Nummer ein." Expected result: Point as decimal separator is accepted. Same behaviour with it-IT, fr-FR, nl-NL However if you set language to en or de-CH, both comma and point are accepted. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17098 Marc Véron <veron@veron.ch> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|enhancement |minor See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=12310 --- Comment #1 from Marc Véron <veron@veron.ch> --- More information: Discussion on IRC: http://irc.koha-community.org/koha/2016-08-09#i_1847065 Bug 12310 - Accept different monetary formats as input -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17098 --- Comment #2 from Marc Véron <veron@veron.ch> --- Files with input type "numeric" (git grep --files-with-matches 'type="number"'): Decimal: koha-tmpl/intranet-tmpl/prog/en/modules/members/mancredit.tt koha-tmpl/intranet-tmpl/prog/en/modules/members/maninvoice.tt Only digits (no problem): koha-tmpl/intranet-tmpl/prog/en/modules/tools/automatic_item_modification_by_age.tt -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17098 Marjorie Barry-Vila <marjorie.barry-vila@ccsr.qc.ca> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |marjorie.barry-vila@ccsr.qc | |.ca -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17098 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |katrin.fischer@bsz-bw.de Severity|minor |normal --- Comment #3 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- We are currently running into this - it's irritating for the libraries tht sometimes you have to use . and other times you have to use , - There is a lot of error potential if you are not careful. Updating severity a bit. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17098 Claire Gravely <claire_gravely@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=17462 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17098 --- Comment #4 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- At the moment this problem exists in 2 files: maninvoice.tt and mancredit.tt. Pasting the fix we did on our installations here for making a proper patch later: --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/maninvoice.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/maninvoice.tt @@ -70,7 +70,7 @@ type_fees['[% invoice_types_loo.authorised_value %]'] = "[% invoice_types_loo.li <li><label for="barcode">Barcode: </label><input type="text" name="barcode" id="barcode" /></li> <li><label for="desc">Description: </label><input type="text" name="desc" id="desc" size="50" /></li> <li><label for="note">Note: </label><input type="text" name="note" size="50" id="note" /></li> - <li><label for="amount">Amount: </label><input type="number" name="amount" id="amount" required="required" value="" step="any" min="0" /> Example: 5.00</li> + <li><label for="amount">Amount: </label><input type="text" pattern="\d+(\.\d{2})?" name="amount" id="amount" required="required" value="" step="any" min="0" /> Example: 5.00</li> </ol></fieldset> <fieldset class="action"><input type="submit" name="add" value="Save" /> <a class="cancel" href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% borrowernumber %]">Cancel</a></fieldset> </form> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17098 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@bugs.koha-c | |ommunity.org --- Comment #5 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- I do not recreate, on /members/maninvoice.pl?borrowernumber=5, I tried with FF ESR 45.4.0 and Chromium 55.0.2883.75. With de-DE, I do see lang=de-DE, but 12.3 and 12,3 are ok -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17098 --- Comment #6 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- If we simply replace type="number" with type="text", we will reintroduce bug 2542. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17098 --- Comment #7 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Jonathan Druart from comment #6)
If we simply replace type="number" with type="text", we will reintroduce bug 2542.
That could work using the pattern attribute indeed. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17098 --- Comment #8 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- (In reply to Jonathan Druart from comment #5)
I do not recreate, on /members/maninvoice.pl?borrowernumber=5, I tried with FF ESR 45.4.0 and Chromium 55.0.2883.75. With de-DE, I do see lang=de-DE, but 12.3 and 12,3 are ok
Hm. That's odd. Might be some change in browser behaviour? We are using ESR at work too. Will retest. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17098 Patrick Robitaille <patrick.robitaille@ccsr.qc.ca> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |patrick.robitaille@ccsr.qc. | |ca -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17098 --- Comment #9 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- I ended up patching it like that: - <li><label for="amount">Amount: </label><input type="number" name="amount" id="amount" required="required" value="" step="any" min="0" /> Example: 5.00</li> + <li><label for="amount">Amount: </label><input type="text" pattern="\d+(\.\d{2})?" name="amount" id="amount" required="required" value="" step="any" min="0" /> Example: 5.00</li> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17098 Fridolin SOMERS <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17098 Victor Grousset/tuxayo <victor.grousset@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |21507 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21507 [Bug 21507] Decimal separators issues in patrons payments/fines, simplified -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17098 Castro B <castro8583bennett@gmx.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |castro8583bennett@gmx.com --- Comment #10 from Castro B <castro8583bennett@gmx.com> --- (In reply to Jonathan Druart from comment #6)
If we simply replace type="number" with type="text" did you test this already?
Castro B, https://www.lasvegas.com.ru/ -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17098 --- Comment #11 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- It could be a mix of having a "German" firefox installed and Plack and other settings... we have seen some weird things happening. See bug 18186. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17098 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |martin.renvoize@ptfs-europe | |.com --- Comment #12 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Popping this in here so we don't loose it. https://technology.blog.gov.uk/2020/02/24/why-the-gov-uk-design-system-team-... -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org