Closed (outdated)
Project:
Webform Validation
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
25 Apr 2017 at 02:47 UTC
Updated:
17 Apr 2026 at 20:37 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
jastraat commentedComment #3
liam morlandWhat if the thousands separator is a different character?
It would be great for this patch to include a test.
Comment #4
jastraat commentedI could reformat this to remove spaces (which is another separator option), but removing periods is more complicated since those could also indicate decimal points.
I would argue that while ideally the comparison validator could support all numeric separator options, supporting at least a few would be better than supporting none.
I also didn't see tests for any of the validation rules - only the act of adding validation to a webform.
Comment #5
liam morlandWhat about figuring out what character is being used for the decimal and removing anything else?
I know that there is not much in the way of tests. If you are able to add something, even just a unit test for the function you are changing, that would be great.
Comment #6
anybodySadly #2 definitely needs work for configuration because
So I'd suggest to add two new options to that validation:
Comment #7
helonaut commentedI agree, this is the solution we implemented in our running website, by altering the module code manually.
Maybe it's just a better idea to enable multiple lines of "replacement rules" with (un)limited + sign buttons like with the Rules module?
Comment #8
mforbes commentedIs it perhaps not that thousands-delimiters are problematic and need to be scrubbed (which is difficult due to decimal separator conflicts), but rather that commas in general are problematic (regardless of whether the comma is used as a thousands-delimiter or as a decimal-delimiter) due to _webform_validation_flatten_array using a comma as an implode character? (near line 983 as of this writing)
If so, I think imploding with some less-likely-to-be-used character would be a decent path forward.
Comment #9
liam morlandPerhaps if both components are of type number, it should cast to a PHP numeric type before making the comparison.
Comment #10
liam morlandDrupal 7 is no longer supported. If this applies to a supported version, please re-open.