View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
06171 | Bug reports | Survey taking | public | 2012-06-05 15:16 | 2012-06-20 16:43 |
Reporter | TMSWhite | Assigned To | TMSWhite | ||
Priority | normal | Severity | minor | ||
Status | closed | Resolution | fixed | ||
Product Version | 1.92+ | ||||
Fixed in Version | 1.92+ | ||||
Summary | 06171: variable < X is true even if variable isn't answered | ||||
Description | This is a known limitation from Expression Manager. Opening this as a bug so that users are aware of it (and on the off chance that someone can figure out a solution). | ||||
Additional Information | Version 1.92 gives different answers for less-than / greater-than comparisons against empty values compared to earlier versions. We went to great pains to prevent this, but since we needed to have the Expressions generate identical results in PHP and JavaScript, there was no way to make 1.92 treat "" < 16 as FALSE. Fortunately, there is an easy work-around for this. If you want (age < 16) to be FALSE, then use this expression instead: {(!is_empty(age) and age < 16)}. You can use the new Survey Logic File view to quickly identify and fix any such comparisons in your survey. | ||||
Tags | No tags attached. | ||||
Attached Files | |||||
Bug heat | 4 | ||||
Complete LimeSurvey version number (& build) | 120530 | ||||
I will donate to the project if issue is resolved | No | ||||
Browser | |||||
Database type & version | Mysql 5.3 | ||||
Server OS (if known) | Windows XP | ||||
Webserver software & version (if known) | XAMPP | ||||
PHP Version | 5.3 | ||||
Attached are screen-shots from the EM Unit Test suite showing the current behavior of mathematical comparisons against empty and 0. Green-colored cells have the expected answer. Red-colored cells are errors in that the value differs from what users might expect. Importantly, note that sometimes PHP gives the expected answer and JavaScript does not, and vice-versa. |
|
emptymath5.jpg shows workable solutions for each of the comparisons of a variable (which might be empty or blank) vs. zero, a constant, or another variable. Note that the hard one is (var != 0). For the rest, say you have a comparison var op val You would change that to: !is_empty(var) && (var op val) For (var != 0), you change it to: is_empty(var) || (var != 0) |
|
I updated the upgrade hints to clarify how to work-around this situation. |
|
Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=8657 |
|
Fix committed to Yii branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=8658 |
|
Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=8659 |
|
Fix committed to Yii branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=8664 |
|
New 1.91+ build released. |
|
LimeSurvey: master cc83ee5e 2012-06-05 11:23 Details Diff |
Dev Added test cases for issue 06171: variable < X is true even if variable isn't answered |
Affected Issues 06171 |
|
mod - classes/expressions/ExpressionManager.php | Diff File | ||
LimeSurvey: Yii 462912a9 2012-06-05 12:48 Details Diff |
Dev Added test cases for issue 06171: variable < X is true even if variable isn't answered |
Affected Issues 06171 |
|
mod - application/helpers/expressions/em_core_helper.php | Diff File | ||
LimeSurvey: master 6a43810b 2012-06-05 13:33 Details Diff |
Fixed issue 06171: variable < X is true even if variable isn't answered Dev This now works automatically for authors who use the conditions editor Dev To bulk-convert the entire database, call http://localhost/limesurvey/admin/admin.php?action=EMtest&subaction=upgrade_conditions2relevance Dev Authors who manually enter relevance equations must pay more attention to the upgrade hints - http://docs.limesurvey.org/Upgrade+hints+for+version+1.92#Mathematical_comparisons_against_empty_no_responses |
Affected Issues 06171 |
|
mod - classes/expressions/ExpressionManager.php | Diff File | ||
mod - classes/expressions/LimeExpressionManager.php | Diff File | ||
LimeSurvey: Yii 9a329a94 2012-06-05 14:08 Details Diff |
Fixed issue 06171: variable < X is true even if variable isn't answered Dev This now works automatically for authors who use the conditions editor Dev To bulk-convert the entire database, call http://localhost/limesurvey/index.php/admin/expressions/upgrade_conditions2relevance Dev Authors who manually enter relevance equations must pay more attention to the upgrade hints - http://docs.limesurvey.org/Upgrade+hints+for+version+1.92#Mathematical_comparisons_against_empty_no_responses |
Affected Issues 06171 |
|
mod - application/helpers/expressions/em_core_helper.php | Diff File | ||
mod - application/helpers/expressions/em_manager_helper.php | Diff File | ||
LimeSurvey: master 8bce8d19 2012-06-05 22:55 Details Diff |
Fixed issue 06171: variable < X is true even if variable isn't answered Dev Now automatically upgrades all conditions in database via database version upgrade |
Affected Issues 06171 |
|
mod - admin/import_functions.php | Diff File | ||
mod - admin/importgroup.php | Diff File | ||
mod - admin/importlabel.php | Diff File | ||
mod - admin/importquestion.php | Diff File | ||
mod - admin/install/cmd_install.php | Diff File | ||
mod - admin/update/updater.php | Diff File | ||
mod - admin/update/upgrade-mssql.php | Diff File | ||
mod - admin/update/upgrade-mssqlnative.php | Diff File | ||
mod - admin/update/upgrade-mysql.php | Diff File | ||
mod - admin/update/upgrade-postgres.php | Diff File | ||
mod - common.php | Diff File | ||
mod - version.php | Diff File | ||
LimeSurvey: Yii 9e486677 2012-06-06 10:57 Details Diff |
Fixed issue 06171: variable < X is true even if variable isn't answered Dev Now automatically upgrades all conditions in database via database version upgrade |
Affected Issues 06171, 06172 |
|
mod - application/config/version.php | Diff File | ||
mod - application/helpers/update/updatedb_helper.php | Diff File |
Date Modified | Username | Field | Change |
---|---|---|---|
2012-06-05 15:16 | TMSWhite | New Issue | |
2012-06-05 17:07 | TMSWhite | Note Added: 19073 | |
2012-06-05 17:07 | TMSWhite | File Added: emptymath1.jpg | |
2012-06-05 17:07 | TMSWhite | File Added: emptymath2.jpg | |
2012-06-05 17:08 | TMSWhite | File Added: emptymath3.jpg | |
2012-06-05 17:26 | TMSWhite | File Added: emptymath4.jpg | |
2012-06-05 17:49 | TMSWhite | File Deleted: emptymath4.jpg | |
2012-06-05 17:49 | TMSWhite | File Added: emptymath5.jpg | |
2012-06-05 17:52 | TMSWhite | Note Added: 19074 | |
2012-06-05 18:18 | TMSWhite | Note Added: 19075 | |
2012-06-05 18:25 | TMSWhite | Changeset attached | => LimeSurvey master cc83ee5e |
2012-06-05 19:49 | TMSWhite | Changeset attached | => LimeSurvey Yii 462912a9 |
2012-06-05 20:34 | TMSWhite | Changeset attached | => LimeSurvey master 6a43810b |
2012-06-05 20:34 | TMSWhite | Note Added: 19076 | |
2012-06-05 20:34 | TMSWhite | Assigned To | => TMSWhite |
2012-06-05 20:34 | TMSWhite | Resolution | open => fixed |
2012-06-05 21:10 | TMSWhite | Changeset attached | => LimeSurvey Yii 9a329a94 |
2012-06-05 21:10 | TMSWhite | Note Added: 19077 | |
2012-06-05 21:13 | TMSWhite | Status | new => resolved |
2012-06-05 21:13 | TMSWhite | Fixed in Version | => 1.92+ |
2012-06-06 06:10 | TMSWhite | Changeset attached | => LimeSurvey master 8bce8d19 |
2012-06-06 06:10 | TMSWhite | Note Added: 19078 | |
2012-06-06 18:23 | TMSWhite | Changeset attached | => LimeSurvey Yii 9e486677 |
2012-06-06 18:23 | TMSWhite | Note Added: 19084 | |
2012-06-07 11:02 | c_schmitz | Note Added: 19097 | |
2012-06-07 11:02 | c_schmitz | Status | resolved => closed |
2012-06-20 16:43 | TMSWhite | Relationship added | related to 06240 |