View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
07805 | Bug reports | Expression Manager | public | 2013-04-29 16:12 | 2019-10-31 10:21 |
Reporter | DenisChenu | Assigned To | DenisChenu | ||
Priority | normal | Severity | minor | ||
Status | closed | Resolution | fixed | ||
Product Version | 2.00+ | ||||
Target Version | 2.05 RC | Fixed in Version | 2.05+ | ||
Summary | 07805: Comparaison String and Numeric is different in same page and other page | ||||
Description | When doing some comparaison in string and "strin can be numeric". EM don't return the same in same page and other page | ||||
Steps To Reproduce | Import survey attached and try some combination. | ||||
Additional Information | In javascript, we take value with $(QQ).text(); if this value can be numeric we force it to be numeric: em_javascript.js line 594 To have near the same issue in PHP, we do the same think: BUT when we compare, we can have some difference between js and PHP: "A" > "1" is true in Javascript, but in em_core_helper: we do: | ||||
Tags | No tags attached. | ||||
Attached Files | |||||
Bug heat | 8 | ||||
Complete LimeSurvey version number (& build) | 130429 | ||||
I will donate to the project if issue is resolved | No | ||||
Browser | FF16 | ||||
Database type & version | not relevant | ||||
Server OS (if known) | debian/linux | ||||
Webserver software & version (if known) | apache | ||||
PHP Version | PHP Version 5.3 | ||||
related to | 08217 | closed | DenisChenu | "Numerical Input" question validation only client side |
parent of | 08324 | closed | DenisChenu | Broken numeric interpretation of answer codes. |
related to | 12613 | closed | ollehar | Condition NAOK >= " " (no answer) evaluated differently in JS/PHP |
related to | 14337 | closed | DenisChenu | Broken numeric interpretation of answer codes |
related to | 15501 | closed | ollehar | relevanceStatus : different evaluation in JS and PHP |
child of | 07763 | closed | DenisChenu | Answers not saved in database |
Cartsen : think really EM PHP is the good solution here. But change in javascript to have the same way than em/php seems to be a bad idea: Alternative is to force string compare in PHP if one is a string, but actaully we can't know if it: If we allways for string comparaison: |
|
No matter how it works it, it should be consistent between PHP and Javascript. |
|
Use EM attribute isnumeric in JS and in PHP. Seems it's OK, some test to do I fix in pull request, because maybe it can break some Survey (using bug). |
|
Fix committed to 2.05 branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=13295 |
|
2.05RC3 released |
|
Another solution: Then : Sam : are you OK or did you have an idea to have: |
|
As discussed in IRC; i think if you quote it it's a string and if you don't it's a number. If you use a variable then always try to interpret it, alternatively we could offer syntax like: 1 * A1 that would effectively force it to be a number. |
|
OK, then take it, not sure for "1"+QCODE+1 but let's try |
|
Fix committed to 2.05 branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=13484 |
|
Now :don't find any difference in JS and PHP. Else : PS: put 2 new test lss file |
|
2.05RC7 released. |
|
LimeSurvey: 2.05 28d42568 2013-10-18 11:10 Details Diff |
Fixed issue 07805: Comparaison String and Numeric is different in same page and other page Dev: some test seems to fix issue Dev: js use attr isnumeric, then add it to PHP too Dev: Please do some test (but seems better than actually) |
Affected Issues 07805 |
|
mod - application/helpers/common_helper.php | Diff File | ||
mod - application/helpers/expressions/em_core_helper.php | Diff File | ||
mod - application/helpers/expressions/em_manager_helper.php | Diff File | ||
mod - scripts/expressions/em_javascript.js | Diff File | ||
mod - scripts/survey_runtime.js | Diff File | ||
LimeSurvey: 2.05 2ff91165 2013-10-31 14:16 Details Diff |
Dev: fixed issue 08324: Broken numeric interpretation of answer codes. Dev: this reopen 07805: because "1" is string in JS |
Affected Issues 07805, 08324 |
|
mod - application/helpers/expressions/em_core_helper.php | Diff File | ||
mod - scripts/expressions/em_javascript.js | Diff File | ||
LimeSurvey: 2.05 fa699d03 2013-11-21 17:56 Details Diff |
Fixed issue 07805: Comparaison String and Numeric is different in same page and other page (second time) Dev: keep the + for sum is 2 are numeric except if explicit STRING, then join Dev: comparaison of Question result return allways false if one can be numerci and the other not Dev: then if need compare string, better use ""+QCODE > ""+QCODE2 |
Affected Issues 07805 |
|
mod - application/helpers/expressions/em_core_helper.php | Diff File |
Date Modified | Username | Field | Change |
---|---|---|---|
2013-04-29 16:12 | DenisChenu | New Issue | |
2013-04-29 16:12 | DenisChenu | File Added: limesurvey_survey_EMJS-EMPHP.lss | |
2013-04-29 16:12 | DenisChenu | Relationship added | child of 07763 |
2013-04-29 16:13 | DenisChenu | Issue Monitored: c_schmitz | |
2013-04-29 16:18 | DenisChenu | Note Added: 25164 | |
2013-09-19 13:39 | c_schmitz | Note Added: 26292 | |
2013-09-19 13:39 | c_schmitz | Target Version | => 2.05 RC |
2013-10-11 13:06 | c_schmitz | Assigned To | => DenisChenu |
2013-10-11 13:06 | c_schmitz | Status | new => assigned |
2013-10-11 13:06 | DenisChenu | Relationship added | related to 08217 |
2013-10-16 11:41 | DenisChenu | Note Added: 26822 | |
2013-10-18 11:29 | DenisChenu | File Added: limesurvey_survey_notsameDefault.lss | |
2013-10-18 11:33 | DenisChenu | File Added: limesurvey_survey_notsame-NOdefault.lss | |
2013-10-21 12:40 | DenisChenu | Changeset attached | => LimeSurvey 2.05 28d42568 |
2013-10-21 12:40 | DenisChenu | Note Added: 26870 | |
2013-10-21 12:40 | DenisChenu | Resolution | open => fixed |
2013-10-21 12:42 | DenisChenu | Status | assigned => resolved |
2013-10-21 12:42 | DenisChenu | Fixed in Version | => 2.05+ |
2013-10-23 14:39 | c_schmitz | Note Added: 26948 | |
2013-10-23 14:39 | c_schmitz | Status | resolved => closed |
2013-10-31 10:11 | DenisChenu | Relationship added | parent of 08324 |
2013-10-31 14:18 | DenisChenu | Assigned To | DenisChenu => sammousa |
2013-10-31 14:18 | DenisChenu | Status | closed => feedback |
2013-10-31 14:18 | DenisChenu | Resolution | fixed => reopened |
2013-11-03 16:17 | DenisChenu | Changeset attached | => LimeSurvey 2.05 2ff91165 |
2013-11-15 19:04 | DenisChenu | Note Added: 27202 | |
2013-11-15 19:04 | DenisChenu | Status | feedback => assigned |
2013-11-21 10:48 | sammousa | Note Added: 27282 | |
2013-11-21 16:54 | DenisChenu | Note Added: 27295 | |
2013-11-21 16:54 | DenisChenu | Assigned To | sammousa => DenisChenu |
2013-11-21 17:56 | DenisChenu | Changeset attached | => LimeSurvey 2.05 fa699d03 |
2013-11-21 17:56 | DenisChenu | Note Added: 27296 | |
2013-11-21 17:57 | DenisChenu | File Added: limesurvey_survey_EMJS-EMPHP-add.lss | |
2013-11-21 17:57 | DenisChenu | File Added: limesurvey_survey_EMJS-EMPHP-compare.lss | |
2013-11-21 17:57 | DenisChenu | File Deleted: limesurvey_survey_EMJS-EMPHP.lss | |
2013-11-21 17:57 | DenisChenu | File Deleted: limesurvey_survey_notsameDefault.lss | |
2013-11-21 17:57 | DenisChenu | File Deleted: limesurvey_survey_notsame-NOdefault.lss | |
2013-11-21 18:00 | DenisChenu | Note Added: 27297 | |
2013-11-21 18:00 | DenisChenu | Status | assigned => resolved |
2013-11-21 18:00 | DenisChenu | Resolution | reopened => fixed |
2013-11-21 18:01 | DenisChenu | Note Edited: 27297 | |
2013-11-25 15:39 | c_schmitz | Note Added: 27388 | |
2013-11-25 15:39 | c_schmitz | Status | resolved => closed |
2017-08-21 12:04 | ollehar | Relationship added | related to 12613 |
2018-12-11 15:32 | DenisChenu | Relationship added | related to 14337 |
2019-10-31 10:21 | DenisChenu | Relationship added | related to 15501 |