View Issue Details

This bug affects 1 person(s).
 4
IDProjectCategoryView StatusLast Update
04821Bug reportsSurvey editingpublic2011-01-12 18:07
Reporteruser11155Assigned Tojcleeland  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Product Version1.91beta 
Fixed in Version1.91RC1 
Summary04821: 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.
2) Open the survey

Select any option under
"You can filter some question with a multi choice option.
Check any that apply"

They wouldn't come up in the "Filtered array with previous question." question.

TagsNo tags attached.
Attached Files
limesurvey_group_6.lsg (13,322 bytes)
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;
04823_patch_TP.patch (2,114 bytes)   
Bug heat4
Complete LimeSurvey version number (& build)9619
I will donate to the project if issue is resolvedNo
Browser
Database type & versionMySQL 5.1.41
Server OS (if known)Linux 1.7.3a
Webserver software & version (if known)Apache 2.2.14
PHP Version5.3.1

Relationships

parent of 04823 closedjcleeland The percentage completed bar is not working on some pages 

Users monitoring this issue

There are no users monitoring this issue.

Activities

tpartner

tpartner

2010-12-14 01:15

partner   ~13776

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

jcleeland

jcleeland

2010-12-14 01:53

reporter   ~13777

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

tpartner

tpartner

2010-12-14 02:30

partner   ~13779

Thanks Jason, I've applied the patch.

sush, thanks for the report.

Fixed in revision 9638.

Issue History

Date Modified Username Field Change
2010-12-13 18:01 user11155 New Issue
2010-12-13 18:01 user11155 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