View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 05340 | Bug reports | RemoteControl | public | 2011-07-12 00:04 | 2012-07-19 23:36 |
| Reporter | pdedou | Assigned To | |||
| Priority | normal | Severity | block | ||
| Status | closed | Resolution | fixed | ||
| Product Version | 1.91+ | ||||
| Summary | 05340: fSendStatistic function crashes when there is at least one array type question in the survey you need to have statistics for. | ||||
| Description | The following error comes up, when u use fSendStatistic via LSRC so as to send statistics for a survey that contains at least one array type question: Couldn't do count of values | ||||
| Steps To Reproduce |
| ||||
| Tags | No tags attached. | ||||
| Attached Files | statistics_function.php.diff (1,526 bytes)
Index: statistics_function.php
===================================================================
--- statistics_function.php (revision 10404)
+++ statistics_function.php (working copy)
@@ -142,14 +142,17 @@
if($q2show=='all' )
{
- $summarySql=" SELECT gid, parent_qid, qid, type "
- ." FROM {$dbprefix}questions WHERE parent_qid=0"
- ." AND sid=$surveyid ";
+ $summarySql=" SELECT gid, parent_qid, qid, type, title "
+ ." FROM {$dbprefix}questions"
+ ." WHERE sid=$surveyid ";
$summaryRs = db_execute_assoc($summarySql);
foreach($summaryRs as $field)
{
+ if ($field['parent_qid'] == 0) {
+ // Not array type
+ if (($field['type'] != "A") && ($field['type'] != "B") && ($field['type'] != "C") && ($field['type'] != "D") && ($field['type'] != "E") && ($field['type'] != "F")) {
$myField = $surveyid."X".$field['gid']."X".$field['qid'];
// Multiple choice get special treatment
@@ -181,11 +184,20 @@
}
- if($q2show=='all')
- $summary[]=$myField;
- //$allfields[]=$myField;
+
}
+ }
+ else {
+ $myField = $surveyid."X".$field['gid']."X".$field['parent_qid'].$field['title'];
+ }
+
+ if($q2show=='all' && $myField!=null) {
+ $summary[]=$myField;
+ }
+ //$allfields[]=$myField;
+ $myField = null;
+ }
}
else
{
| ||||
| Bug heat | 4 | ||||
| Complete LimeSurvey version number (& build) | 10377 | ||||
| I will donate to the project if issue is resolved | No | ||||
| Browser | |||||
| Database type & version | MySQL 5.5.12 | ||||
| Server OS (if known) | Windows 7 Home Premium 64-bit | ||||
| Webserver software & version (if known) | JBOSS 4.2.2.G.A. | ||||
| PHP Version | 5.3.6 | ||||
| Git branch / Pull Request URL | |||||
|
I have done the attached patch, which gives you the opportunity to send statistics via LSRC even if you use array type questions in your survey. However, the statistics of each question appear in a random position. |
|
|
It seems to work fine with the second patch (statistics_function.php.diff2). The statistics of each question appear in the right position now. |
|
|
Fixed in 2.00RC6 2.00RC6 released. |
|
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2011-07-12 00:04 | pdedou | New Issue | |
| 2011-07-12 14:59 | c_schmitz | Assigned To | => elameno |
| 2011-07-12 14:59 | c_schmitz | Status | new => assigned |
| 2011-07-12 14:59 | c_schmitz | Priority | immediate => normal |
| 2011-08-08 17:13 | pdedou | File Added: statistics_function.php.diff | |
| 2011-08-08 17:14 | pdedou | Note Added: 15990 | |
| 2011-08-23 20:01 | pdedou | File Added: statistics_function.php.diff2 | |
| 2011-08-23 20:03 | pdedou | Note Added: 16124 | |
| 2011-08-23 20:03 | pdedou | Issue Monitored: pdedou | |
| 2011-08-23 20:04 | pdedou | Issue End Monitor: pdedou | |
| 2011-10-08 22:37 | c_schmitz | Status | assigned => confirmed |
| 2011-10-20 18:29 | c_schmitz | Category | RemoteControl => (No Category) |
| 2012-06-21 14:33 | c_schmitz | Assigned To | elameno => |
| 2012-06-21 14:33 | c_schmitz | Category | (No Category) => RemoteControl |
| 2012-07-19 23:36 | c_schmitz | Note Added: 19851 | |
| 2012-07-19 23:36 | c_schmitz | Status | confirmed => closed |
| 2026-10-25 16:41 | c_schmitz | Resolution | open => fixed |