View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 04821 | Bug reports | Survey editing | public | 2010-12-13 18:01 | 2011-01-12 18:07 |
| Reporter | Assigned To | jcleeland | |||
| Priority | normal | Severity | minor | ||
| Status | closed | Resolution | fixed | ||
| Product Version | 1.91beta | ||||
| Fixed in Version | 1.91RC1 | ||||
| Summary | 04821: Filtered array with previous question not working | ||||
| Description | "Filtered array with previous question" is not working | ||||
| Steps To Reproduce | 1) Import the attached question group to the survey. Select any option under They wouldn't come up in the "Filtered array with previous question." question. | ||||
| Tags | No tags attached. | ||||
| Attached Files | 04823_patch_TP.patch (2,114 bytes)
Index: group.php
===================================================================
--- group.php (revision 9637)
+++ group.php (working copy)
@@ -1010,7 +1010,7 @@
{
$qquery = "SELECT {$dbprefix}answers.code as title, {$dbprefix}questions.type, {$dbprefix}questions.other FROM {$dbprefix}answers, {$dbprefix}questions WHERE {$dbprefix}answers.qid={$dbprefix}questions.qid AND {$dbprefix}answers.qid='".$attralist['qid']."' AND {$dbprefix}answers.language='".$_SESSION['s_lang']."' order by code;";
} else {
- $qquery = "SELECT title, type, other FROM {$dbprefix}questions WHERE (parent_qid='".$attralist['qid']."' OR qid='".$attralist['qid']."') AND language='".$_SESSION['s_lang']."' and scale_id=0 order by title;";
+ $qquery = "SELECT title, type, other FROM {$dbprefix}questions WHERE (parent_qid='".$attralist['qid']."' OR qid='".$attralist['qid']."') AND parent_qid!=0 AND language='".$_SESSION['s_lang']."' and scale_id=0 order by title;";
}
$qresult = db_execute_assoc($qquery); //Checked
$other=null;
@@ -1093,7 +1093,7 @@
{
$qquery = "SELECT {$dbprefix}answers.code as title, {$dbprefix}questions.type, {$dbprefix}questions.other FROM {$dbprefix}answers, {$dbprefix}questions WHERE {$dbprefix}answers.qid={$dbprefix}questions.qid AND {$dbprefix}answers.qid='".$attralist['qid']."' AND {$dbprefix}answers.language='".$_SESSION['s_lang']."' order by code;";
} else {
- $qquery = "SELECT title, type, other FROM {$dbprefix}questions WHERE (parent_qid='".$attralist['qid']."' OR qid='".$attralist['qid']."') AND language='".$_SESSION['s_lang']."' and scale_id=0 order by title;";
+ $qquery = "SELECT title, type, other FROM {$dbprefix}questions WHERE (parent_qid='".$attralist['qid']."' OR qid='".$attralist['qid']."') AND parent_qid!=0 AND language='".$_SESSION['s_lang']."' and scale_id=0 order by title;";
}
$qresult = db_execute_assoc($qquery); //Checked
$other=null;
| ||||
| Bug heat | 4 | ||||
| Complete LimeSurvey version number (& build) | 9619 | ||||
| I will donate to the project if issue is resolved | No | ||||
| Browser | |||||
| Database type & version | MySQL 5.1.41 | ||||
| Server OS (if known) | Linux 1.7.3a | ||||
| Webserver software & version (if known) | Apache 2.2.14 | ||||
| PHP Version | 5.3.1 | ||||
|
Jason, I've tested this and can reproduce the problem. The JavaScript is failing because an invalid selector is being inserted by the array-filter/array-filter-exclusion code. It's picking up the parent question code and appending it to an array row ID. This row doesn't exist so everything comes grinding to a halt. I've attached a patch but could you please review it to make sure it doesn't screw up your fix for bug 04683? Thanks |
|
|
The patch looks good to me, don't think it will screw up 04683 :-) If it does, then it just becomes more for me to do on that one! Thanks @tpartner |
|
|
Thanks Jason, I've applied the patch. sush, thanks for the report. Fixed in revision 9638. |
|
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2010-12-13 18:01 |
|
New Issue | |
| 2010-12-13 18:01 |
|
File Added: limesurvey_group_6.lsg | |
| 2010-12-14 01:14 | tpartner | File Added: 04823_patch_TP.patch | |
| 2010-12-14 01:15 | tpartner | Assigned To | => jcleeland |
| 2010-12-14 01:15 | tpartner | Status | new => assigned |
| 2010-12-14 01:15 | tpartner | Note Added: 13776 | |
| 2010-12-14 01:17 | tpartner | Relationship added | parent of 04823 |
| 2010-12-14 01:53 | jcleeland | Note Added: 13777 | |
| 2010-12-14 02:30 | tpartner | Note Added: 13779 | |
| 2010-12-14 02:30 | tpartner | Status | assigned => resolved |
| 2010-12-14 02:30 | tpartner | Resolution | open => fixed |
| 2011-01-12 18:07 | c_schmitz | Status | resolved => closed |
| 2011-01-12 18:07 | c_schmitz | Fixed in Version | => 1.91RC1 |
| 2019-11-01 17:25 | c_schmitz | Category | Survey design => Survey editing |