View Issue Details

IDProjectCategoryView StatusLast Update
15011Bug reports[All Projects] Otherpublic2019-07-04 11:38
Reportercdorin Assigned Todominikvitt  
PrioritynoneSeveritymajor 
Status resolvedResolutionfixed 
Product Version3.17.x 
Target VersionFixed in Version3.17.x 
Summary15011: Regular expression - issue - LimeSurvey "removes" 0
Description

Check the attached survey, and then test it in regex101 (ecmascript/javascript).

It works there, but not in LimeSurvey. (import the attached .lss)

Tested expression: /^[0-9]{4,5}$/

TagsNo tags attached.
Complete LimeSurvey version number (& build)irrelevant
I will donate to the project if issue is resolvedNo
Browser
Database & DB-Versionirrelevant
Server OS (if known)
Webserver software & version (if known)
PHP Versionirrelevant

Relationships

related to 15009 assignedcdorin Not number show as number 

Activities

cdorin

cdorin

2019-07-02 14:14

manager  

limesurvey_survey_921581.lss (14,422 bytes)
dominikvitt

dominikvitt

2019-07-03 08:03

developer   ~52688

@DenisChenu:
It looks that LEMval method converts '0000' into 0.
Is there any way around it?

DenisChenu

DenisChenu

2019-07-03 09:07

developer   ~52689

See new issue here : https://bugs.limesurvey.org/view.php?id=15009

In 3.X : TEXT.NAOK : 0001 => 1
In 2. X : TEXT.NAOK : 0001 => 0001

In 3.X seems TEXT.shown : 0001 => 0001

I think the issue is here : https://github.com/LimeSurvey/LimeSurvey/blob/db0310d6559f8114beaced4222c0bd7321caa204/assets/scripts/expressions/em_javascript.js#L712-L725
Line 720 never happen

In 2.6 : https://github.com/SondagesPro/LimeSurvey-SondagesPro/blob/2.06_SondagesPro/scripts/expressions/em_javascript.js#L463-L471

There are an issue in 2.6 too :
TEXT.NAOK 1.1 become 1,1 : i really think it's bad , must be done only if it's a number.

dominikvitt

dominikvitt

2019-07-03 14:53

developer   ~52692

This issue is fixed.
The patch is available now on GitHub and will be available on next LimeSurvey release.

https://github.com/LimeSurvey/LimeSurvey/commit/1ce7be1c707a7beb51ee80dfbceaf49cb7838548

dominikvitt

dominikvitt

2019-07-04 11:38

developer   ~52721

Correction:
https://github.com/LimeSurvey/LimeSurvey/commit/e4912fdbb480de2e1272afc3b47ca364d623c474

Issue History

Date Modified Username Field Change
2019-07-02 14:14 cdorin New Issue
2019-07-02 14:14 cdorin Status new => assigned
2019-07-02 14:14 cdorin Assigned To => dominikvitt
2019-07-02 14:14 cdorin File Added: limesurvey_survey_921581.lss
2019-07-03 08:03 dominikvitt Note Added: 52688
2019-07-03 09:07 DenisChenu Note Added: 52689
2019-07-03 09:08 DenisChenu Relationship added related to 15009
2019-07-03 14:53 dominikvitt Status assigned => resolved
2019-07-03 14:53 dominikvitt Resolution open => fixed
2019-07-03 14:53 dominikvitt Fixed in Version => 3.17.x
2019-07-03 14:53 dominikvitt Note Added: 52692
2019-07-04 11:38 dominikvitt Note Added: 52721