View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
15405 | Bug reports | Expression Manager | public | 2019-10-15 11:32 | 2021-03-10 17:07 |
Reporter | ollehar | Assigned To | ollehar | ||
Priority | none | Severity | partial_block | ||
Status | closed | Resolution | fixed | ||
Product Version | 3.18.0 | ||||
Target Version | 3.18.x | ||||
Summary | 15405: Numerical vs alphabetical order in EM, <, >, vs strcmp etc | ||||
Description | Two problems: "2" > "18" behaves differently in JS and PHP Second problem: The intuition behind "A2" > "A18" is wrong Default answer code is A1. Press plus, and it become A10, A11, etc. Condition designer uses <, >, etc, but comparing "A2" < "A18" is probably not what user wants (instead "A02" < "A18" OR compare question order). | ||||
Steps To Reproduce | User had survey which broke. Mandatory question was hidden on client (browser) but "shown" on server, leading to mandatory violation BUT without any possibility to actually fill in the question. The origin of the problem was "2" > "18" (age compare). | ||||
Additional Information | Two commits (that were reverted): 0dee716e8bcc01eceff9c85d9de1a5b5a815c647 efa8a1012897af32632737c92e2d98f433cf6ba8 | ||||
Tags | No tags attached. | ||||
Attached Files | |||||
Bug heat | 6 | ||||
Complete LimeSurvey version number (& build) | latest master | ||||
I will donate to the project if issue is resolved | No | ||||
Browser | - | ||||
Database type & version | - | ||||
Server OS (if known) | - | ||||
Webserver software & version (if known) | - | ||||
PHP Version | - | ||||
"2" > "18" is not really different (bvecause you can 't have it in JS) With Q00 as single choice with number Q00 as 5 : Q00 < "10" is different in PHP and JS … Maybe must be STRING for both ?
|
|
@ollehar : in my opinion : must separate the issue
PS : since 2.05 : my advice when compare number is always do intval(Q00) before ;) |
|
But we agree: Warning (or error) when doing "18", e.g. [0-9]* in quote? |
|
Yes : my opinion :
The A2 > A10 is another issue :) |
|
Related: Lots of people (except Denis) agree answer codes should be numeric as default, not alphanumeric. |
|
My real opinion : empty default answer code (for the 1st) Same for subquestion code :D |
|
@ollehar : can we list the real part wher it's broken : i mean compare is different between PHP and JS ? |
|
"2" > "18" is different in PHP and JS. |
|
But : did you have a Survey for this. I know it's different, but since we have an hacked compare with PHP : maybe we can try to dix it . |
|
I think i do an error : For example (in JS)
|
|
Please, don't try to hack EM more - it's already too complex. The best solution is a warning message, IMO. |
|
Not for this part : since code are already updated since some year now … The fix can be use && here : https://github.com/LimeSurvey/LimeSurvey/blob/033b995ee5698109120694479a391b3e2ec59ad5/application/helpers/expressions/em_core_helper.php#L328 |
|
Again, I disagree. Writing < "18" is always a conceptual error from the users side. |
|
Yes, it can be. But the biggest issue : JS must be same than PHP. Since it's hard ( impossible ?) to fix
|
|
|
|
Date Modified | Username | Field | Change |
---|---|---|---|
2019-10-15 11:32 | ollehar | New Issue | |
2019-10-15 11:34 | ollehar | Steps to Reproduce Updated | |
2019-10-15 11:37 | ollehar | Additional Information Updated | |
2019-10-15 11:38 | DenisChenu | Note Added: 54044 | |
2019-10-15 11:38 | DenisChenu | Note Edited: 54044 | |
2019-10-15 11:41 | ollehar | Description Updated | |
2019-10-15 11:42 | DenisChenu | File Added: limesurvey_survey_jsphpIssueCompare.lss | |
2019-10-15 11:43 | DenisChenu | Note Added: 54045 | |
2019-10-15 14:34 | ollehar | Note Added: 54046 | |
2019-10-15 14:37 | DenisChenu | Note Added: 54047 | |
2019-10-15 14:38 | ollehar | Note Added: 54048 | |
2019-10-15 14:41 | DenisChenu | Note Added: 54049 | |
2019-10-17 08:01 | DenisChenu | Note Added: 54067 | |
2019-10-17 10:27 | ollehar | Note Added: 54072 | |
2019-10-17 11:35 | DenisChenu | Note Added: 54078 | |
2019-10-17 11:36 | DenisChenu | Note Added: 54079 | |
2019-10-17 11:38 | ollehar | Note Added: 54081 | |
2019-10-17 11:41 | DenisChenu | Note Added: 54082 | |
2019-10-17 11:47 | ollehar | Note Added: 54083 | |
2019-10-17 12:45 | DenisChenu | Note Added: 54087 | |
2019-10-17 15:10 | ollehar | Note Added: 54088 | |
2019-10-31 10:20 | DenisChenu | Relationship added | related to 15501 |
2019-11-19 16:16 | HSwebteam | Issue Monitored: HSwebteam | |
2021-03-10 17:07 | ollehar | Assigned To | => ollehar |
2021-03-10 17:07 | ollehar | Status | new => closed |
2021-03-10 17:07 | ollehar | Resolution | open => fixed |
2021-08-02 16:27 | guest | Bug heat | 4 => 6 |