View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 08538 | Bug reports | Response browsing | public | 2014-01-14 12:22 | 2014-01-16 16:45 |
| Reporter | afonsocosta | Assigned To | DenisChenu | ||
| Priority | normal | Severity | minor | ||
| Status | closed | Resolution | fixed | ||
| Product Version | 2.05+ | ||||
| Fixed in Version | 2.05+ | ||||
| Summary | 08538: Problem with array (numbers) questions | ||||
| Description | Whenever I add questions Array type (numbers) have a problem. When the survey is on-line the last question type array (numbers) is red like an error. | ||||
| Tags | No tags attached. | ||||
| Attached Files | patch08538.diff (2,039 bytes)
diff --git a/application/helpers/expressions/em_manager_helper.php b/application/helpers/expressions/em_manager_helper.php
index faacc24..7551435 100644
--- a/application/helpers/expressions/em_manager_helper.php
+++ b/application/helpers/expressions/em_manager_helper.php
@@ -1341,6 +1341,7 @@
if ($hasSubqs) {
$subqs = $qinfo['subqs'];
$sq_equs=array();
+ $subqValidEqns = array();
foreach($subqs as $sq)
{
$sq_name = ($this->sgqaNaming)?$sq['rowdivid'].".NAOK":$sq['varName'].".NAOK";
@@ -1675,6 +1676,7 @@
if ($hasSubqs) {
$subqs = $qinfo['subqs'];
$sq_equs=array();
+ $subqValidEqns = array();
foreach($subqs as $sq)
{
$sq_name = ($this->sgqaNaming)?substr($sq['jsVarName'],4).".NAOK":$sq['varName'].".NAOK";
@@ -2446,6 +2448,7 @@
if ($hasSubqs) {
$subqs = $qinfo['subqs'];
$sq_equs=array();
+ $subqValidEqns=array();
foreach($subqs as $sq)
{
$sq_name = ($this->sgqaNaming)?$sq['rowdivid'].".NAOK":$sq['varName'].".NAOK";
@@ -2481,6 +2484,7 @@
if ($hasSubqs) {
$subqs = $qinfo['subqs'];
$sq_equs=array();
+ $subqValidEqns=array();
foreach($subqs as $sq)
{
$sq_name = ($this->sgqaNaming)?substr($sq['jsVarName'],4).".NAOK":$sq['varName'].".NAOK";
| ||||
| Bug heat | 12 | ||||
| Complete LimeSurvey version number (& build) | 140109 | ||||
| I will donate to the project if issue is resolved | No | ||||
| Browser | Google Chrome | ||||
| Database type & version | My SQL | ||||
| Server OS (if known) | Linux Appolo | ||||
| Webserver software & version (if known) | CPanel Accelareted 2 | ||||
| PHP Version | 5.3.19 | ||||
|
I cannot reproduce this at all with your survey. Please reduce the survey to a minimum test case and attach it again - thank you. |
|
|
Hi! I attached a new survey with only two questions. Thank you |
|
|
Understand: You set "minimum value" to 1 : then all empty answer are in error. (and your last question is Mandatory : then each text input need an answer). |
|
|
DenisChenu: He means the default state of the reponse before you enter or submit anything |
|
|
Why it happens only in the last question of the survey even before I started to answering the survey? |
|
|
Tony, this seems to be JS/EM related - can you take a look, please? |
|
|
Yes, something bad here : the 1st one must be on error too. |
|
|
Sory, I'm not and advenced user of limesurvey. Where I can see more about JS/EM related? |
|
|
This is not a JavaScript problem directly. It's more of a PHP logic problem in em_manager_helper.php. em_manager_helper.php is generating completely different LEMval[qID]() functions for the questions depending on their placement. I also noticed that the problem only seems to occur if the question is mandatory. I'm afraid someone with a bigger PHP brain than me will have to pick this up. |
|
|
That must be mdekker ;) |
|
|
Think i got it, see patch @mdekker. |
|
|
Denis, looks fine to me - please apply. |
|
|
@DenisChenu Checked the code and it seems you have found all the missing initializations. Nice job! Ok I know this will come back like a boomerang ;-) [rant on] |
|
|
Thanks for all the support. I will try to change the em_manager_helper.php file. |
|
|
@mdekker : for 2.1 : we need a global "EM" set by attribute else we can not extend attribute in Plugin. 1st step is to refactor function _CreateSubQLevelRelevanceAndValidationEqns I think we need some global var at start and find a way to prefill some var to , used by all/lot of part after ($sq_names[] first i think). Hard job here ... and EM have a lot of SQL expression too (need to be replaced by Yii model). |
|
|
Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=13690 |
|
|
2.05+ Build 140116 released |
|
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2014-01-14 12:22 | afonsocosta | New Issue | |
| 2014-01-14 12:22 | afonsocosta | File Added: limesurvey_survey_582171 (1).lss | |
| 2014-01-14 12:53 | afonsocosta | Issue Monitored: afonsocosta | |
| 2014-01-14 14:22 | c_schmitz | Note Added: 27851 | |
| 2014-01-14 14:22 | c_schmitz | Assigned To | => c_schmitz |
| 2014-01-14 14:22 | c_schmitz | Status | new => feedback |
| 2014-01-14 14:26 | afonsocosta | File Added: limesurvey_survey_388849.lss | |
| 2014-01-14 14:27 | afonsocosta | Note Added: 27853 | |
| 2014-01-14 14:27 | afonsocosta | Status | feedback => assigned |
| 2014-01-14 14:28 | DenisChenu | File Added: Capture du 2014-01-14 14:16:32.png | |
| 2014-01-14 14:31 | DenisChenu | Note Added: 27854 | |
| 2014-01-14 14:32 | DenisChenu | Note Edited: 27854 | |
| 2014-01-14 14:39 | c_schmitz | Note Added: 27855 | |
| 2014-01-14 14:39 | afonsocosta | File Added: problem.jpg | |
| 2014-01-14 14:39 | afonsocosta | Note Added: 27856 | |
| 2014-01-14 14:40 | c_schmitz | Note Edited: 27855 | |
| 2014-01-14 14:44 | c_schmitz | Assigned To | c_schmitz => tpartner |
| 2014-01-14 14:44 | c_schmitz | Note Added: 27857 | |
| 2014-01-14 15:05 | DenisChenu | Note Added: 27858 | |
| 2014-01-14 15:06 | afonsocosta | Note Added: 27859 | |
| 2014-01-14 17:08 | tpartner | Note Added: 27861 | |
| 2014-01-14 17:08 | tpartner | Assigned To | tpartner => |
| 2014-01-14 17:08 | tpartner | Assigned To | => c_schmitz |
| 2014-01-14 17:09 | tpartner | Note Edited: 27861 | |
| 2014-01-14 17:19 | c_schmitz | Assigned To | c_schmitz => mdekker |
| 2014-01-14 17:19 | c_schmitz | Note Added: 27863 | |
| 2014-01-14 17:27 | DenisChenu | File Added: limesurvey_survey_2array.lss | |
| 2014-01-14 18:03 | DenisChenu | File Added: em_manager_helper.php | |
| 2014-01-14 18:04 | DenisChenu | File Deleted: em_manager_helper.php | |
| 2014-01-14 18:04 | DenisChenu | File Added: patch08538.diff | |
| 2014-01-14 18:04 | DenisChenu | Note Added: 27864 | |
| 2014-01-14 21:25 | c_schmitz | Note Added: 27868 | |
| 2014-01-14 21:29 | c_schmitz | Assigned To | mdekker => DenisChenu |
| 2014-01-15 09:13 | mdekker | Note Added: 27870 | |
| 2014-01-15 09:55 | afonsocosta | Note Added: 27873 | |
| 2014-01-15 10:00 | DenisChenu | Note Added: 27874 | |
| 2014-01-15 10:01 | DenisChenu | Note Edited: 27874 | |
| 2014-01-15 11:29 | DenisChenu | Changeset attached | => LimeSurvey master 24d33028 |
| 2014-01-15 11:29 | DenisChenu | Note Added: 27877 | |
| 2014-01-15 11:29 | DenisChenu | Resolution | open => fixed |
| 2014-01-15 11:29 | DenisChenu | Status | assigned => resolved |
| 2014-01-15 11:29 | DenisChenu | Fixed in Version | => 2.05+ |
| 2014-01-16 16:45 | c_schmitz | Note Added: 27910 | |
| 2014-01-16 16:45 | c_schmitz | Status | resolved => closed |
| 2021-08-03 17:56 | guest | Bug heat | 10 => 12 |