View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
12851 | Bug reports | _ Unknown | public | 2017-10-30 11:16 | 2018-01-15 10:39 |
Reporter | lpetersen | Assigned To | |||
Priority | none | Severity | minor | ||
Status | closed | Resolution | fixed | ||
Product Version | 2.7x.x | ||||
Fixed in Version | 3.0.0-rc.x | ||||
Summary | 12851: Regex for trailing zeroes in numeric input matches only zeroes immediately after decimal sign | ||||
Description | In a (non-integer) numeric input field, I can enter, e.g., This is bothersome when I want to enter a value like | ||||
Steps To Reproduce | Create a survey with a "numeric" input type question, preview that question and try entering 1.2003 into the numeric input field. | ||||
Additional Information | Function fixnum_checkconditions in survey_runtime.js seems to prevent cutting off trailing zeroes in a numeric input field by the following code (lines 216-):
The third group of the regex in the first line, however, does not match trailing zeroes which do not immediately follow the decimal sign. The following change should fix this:
As far as I can see, this patch should also apply to the development version. Thank you for your work and this great software! | ||||
Tags | No tags attached. | ||||
Bug heat | 6 | ||||
Complete LimeSurvey version number (& build) | 2.72.3 (build 171020) | ||||
I will donate to the project if issue is resolved | No | ||||
Browser | Chromium Version 62.0.3202.62 (Official Build) Built on Ubuntu , running on Ubuntu 17.10 (64-Bit) | ||||
Database type & version | MariaDB 10.1.26-MariaDB-0+deb9u1 | ||||
Server OS (if known) | Debian 9.1 | ||||
Webserver software & version (if known) | Apache/2.4.25 (Debian) | ||||
PHP Version | 7.0.23-1~dotdeb+8.1 | ||||
Sorry, I've just seen that the issue is slightly more complex than I thought. The decimal sign needs to be added only when it was suppressed due to the input having no decimals at all, but not otherwise. This should do the trick now (but as you've seen, you shouldn't trust my regex skills):
Sorry for any confusion created. |
|
Fix committed to develop branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=24330 |
|
Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=24331 |
|
Version 3.0.3 released. |
|
LimeSurvey: develop c06d5673 2017-10-30 12:42:58
|
Fixed issue 12851: Regex for trailing zeroes in numeric input matches only zeroes immediately after decimal sign |
Affected Issues 12851 |
|
mod - application/helpers/SurveyRuntimeHelper.php | Diff File | ||
mod - assets/scripts/survey_runtime.js | Diff File | ||
LimeSurvey: master d57b1463 2017-10-30 12:51:05
|
Fixed issue 12851: Regex for trailing zeroes in numeric input matches only zeroes immediately after decimal sign |
Affected Issues 12851 |
|
mod - scripts/survey_runtime.js | Diff File |
Date Modified | Username | Field | Change |
---|---|---|---|
2017-10-30 11:16 | lpetersen | New Issue | |
2017-10-30 12:05 | lpetersen | Note Added: 44897 | |
2017-10-30 12:43 |
|
Assigned To | => markusfluer |
2017-10-30 12:43 |
|
Status | new => resolved |
2017-10-30 12:43 |
|
Resolution | open => fixed |
2017-10-30 12:43 |
|
Fixed in Version | => 3.0.0-rc.x |
2017-10-30 12:43 |
|
Changeset attached | => LimeSurvey develop c06d5673 |
2017-10-30 12:43 |
|
Note Added: 44899 | |
2017-10-30 12:51 |
|
Changeset attached | => LimeSurvey master d57b1463 |
2017-10-30 12:51 |
|
Note Added: 44900 | |
2018-01-15 10:39 | c_schmitz | Note Added: 45759 | |
2018-01-15 10:39 | c_schmitz | Status | resolved => closed |