View Issue Details

This bug affects 1 person(s).
 6
IDProjectCategoryView StatusLast Update
11731Bug reportsOtherpublic2016-11-13 17:20
ReporterTonyM Assigned Toollehar  
PrioritynoneSeverityminor 
Status closedResolutionfixed 
Product Version2.52.x 
Fixed in Version2.55.x 
Summary11731: JavaScript error when the field has a validation regexp, and the input starts with a plus sign
Description

A JavaScript error is thrown when a text input field has a validation regexp, and a user starts the text input with a "+":

Uncaught Error: [DecimalError] Invalid argument: +358

This error causes the .em_regex_validation element to always be shown. It won't disappear even if the regexp matches, as the JS error is thrown.

A plus-prefix is required for international phone numbers' country codes.

Steps To Reproduce
  • Create a type "S" input field
  • Insert /^+\d+/ into the preg validation field
  • Preview the question and try to input a number starting with a plus sign, like "+358"
  • You should see a DecimalError in the browser's JavaScript console
TagsNo tags attached.
Bug heat6
Complete LimeSurvey version number (& build)2.52+160920
I will donate to the project if issue is resolvedNo
Browser
Database type & versionMySQL
Server OS (if known)Debian
Webserver software & version (if known)Apache
PHP Version5 or 7

Relationships

related to 10860 closedDenisChenu Regular expression fail (2.06+) 
related to 11740 closedDenisChenu Decimal throwerreor with negative value 
related to 11894 closedmarkusfluer Regex validation not working as expected when leading zeros are present in short text questions 

Users monitoring this issue

There are no users monitoring this issue.

Activities

ollehar

ollehar

2016-10-14 15:54

administrator   ~41356

Seems like a more general problem. I can't get any regexp to validate.

ollehar

ollehar

2016-10-14 16:38

administrator   ~41359

Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=21023

DenisChenu

DenisChenu

2016-10-15 10:51

developer   ~41365

Thanks for the tip @olle : think it was same issue everywhere we use Decimal($value) we must catch it before.

c_schmitz

c_schmitz

2016-10-18 15:57

administrator   ~41428

Version 2.54.4 released

Related Changesets

LimeSurvey: master 2748c259

2016-10-14 16:38:38

ollehar

Details Diff
Fixed issue 11731: Regexp validation for short-text question Affected Issues
11731
mod - scripts/expressions/em_javascript.js Diff File

Issue History

Date Modified Username Field Change
2016-09-29 20:48 TonyM New Issue
2016-10-02 16:25 DenisChenu Relationship added related to 10860
2016-10-14 15:11 ollehar Assigned To => ollehar
2016-10-14 15:11 ollehar Status new => assigned
2016-10-14 15:54 ollehar Note Added: 41356
2016-10-14 16:38 ollehar Changeset attached => LimeSurvey master 2748c259
2016-10-14 16:38 ollehar Note Added: 41359
2016-10-14 16:38 ollehar Resolution open => fixed
2016-10-14 16:38 ollehar Status assigned => resolved
2016-10-14 16:38 ollehar Fixed in Version => 2.55.x
2016-10-15 10:50 DenisChenu Relationship added related to 11740
2016-10-15 10:51 DenisChenu Note Added: 41365
2016-10-18 15:57 c_schmitz Note Added: 41428
2016-10-18 15:57 c_schmitz Status resolved => closed
2016-11-13 17:20 DenisChenu Relationship added related to 11894