The regular expression for validating number fields was updated in #2573523: Omitting leading zero from decimal fails validation.

Since the x-flag was added to the regexp, using a space ( ) as thousands separator will result in a validation error because the space is not escaped.

Validation error message:
Number field value must format numbers as "12 345,68".

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Rade created an issue. See original summary.

Rade’s picture

This patch will properly escape the separator if it is a space.

Rade’s picture

Status: Active » Needs review
Rade’s picture

Title: Spaced used as thousands separator produces validation error » Space used as thousands separator produces validation error

  • DanChadwick committed ed20639 on 7.x-4.x
    Issue #2627874 by Rade, DanChadwick: Fixed space used as thousands...
DanChadwick’s picture

Status: Needs review » Fixed
FileSize
1.17 KB

Good catch. Since preg_quote isn't doing what we want for space, and since space, comma, and period all need escaping, let's just use \\ to escape the single character.

Committed to 7.x-4.x.

DanChadwick’s picture

Version: 7.x-4.x-dev » 8.x-4.x-dev
Category: Bug report » Task
Status: Fixed » Patch (to be ported)
fenstrat’s picture

Version: 8.x-4.x-dev » 7.x-4.x-dev
Category: Task » Bug report
Status: Patch (to be ported) » Fixed

Closing to clear out the old Webform 8.x-4.x branch. See #2827845: [roadmap] YAML Form 8.x-1.x to Webform 8.x-5.x.

  • DanChadwick committed ed20639 on 8.x-5.x
    Issue #2627874 by Rade, DanChadwick: Fixed space used as thousands...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.