View Issue Details

This bug affects 1 person(s).
 4
IDProjectCategoryView StatusLast Update
08085Bug reportsStatisticspublic2013-09-23 13:27
ReporterMazi Assigned ToDenisChenu  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Product Version2.00+ 
Target Version2.00+Fixed in Version2.00+ 
Summary08085: PHP notice at public statistics prevents results to be shown when using debug=2
Description

When having debug mode enabled, the public statistics for a certain survey (see attachment) are not shown due to a PHP error notice:

"Undefined offset: 0

.../foobar/application/helpers/admin/statistics_helper.php(3289)"

Steps To Reproduce

Set debug mode to 2.

Importing the attached LSA file and pointing your browser to www.mydomain.org/limesurvey/index.php/statistics_user/action/surveyid/429695/language/en should do the trick.

Additional Information

More Yii error information:

3277
3278 default:
3279 return;
3280 break;
3281 }
3282
3283 $q1 = $quartile/4 ($recordCount+1);
3284 $row = $q1-1; // -1 since we start counting at 0
3285 if ($q1 === (int) $q1) {
3286 return $allRows[$row][$fieldname];
3287 } else {
3288 $diff = ($q1 - (int) $q1);
3289 return $allRows[$row][$fieldname] + $diff
($allRows[$row+1][$fieldname]-$allRows[$row][$fieldname]);
3290 }
3291 }
3292
3293
3294 /*
3295
Returns a simple list of values in a particular column, that meet the requirements of the SQL
3296 */
3297 function _listcolumn($surveyid, $column, $sortby="", $sortmethod="", $sorttype="")
3298 {
3299 $search['condition']=Yii::app()->db->quoteColumnName($column)." != ''";
3300 $sDBDriverName=Yii::app()->db->getDriverName();
3301 if ($sDBDriverName=='sqlsrv' || $sDBDriverName=='mssql')
Stack Trace
#0
– /var/www/vhosts/mysurveyhosting.com/httpdocs/templatedemo/application/helpers/admin/statistics_helper.php(1067): statistics_helper->getQuartile(2, "429695X49X1751SQ001", "429695", "", ...)
1062
1063 //CALCULATE QUARTILES
1064 $medcount = $this->getQuartile(0, $fieldname, $surveyid, $sql, $excludezeros); // Get the recordcount
1065 $quartiles = array();
1066 $quartiles[1] = $this->getQuartile(1, $fieldname, $surveyid, $sql, $excludezeros);
1067 $quartiles[2] = $this->getQuartile(2, $fieldname, $surveyid, $sql, $excludezeros);
1068 $quartiles[3] = $this->getQuartile(3, $fieldname, $surveyid, $sql, $excludezeros);
1069
1070 //we just put the total number of records at the beginning of this array
1071 array_unshift($showem, array($statlang->gT("Count"), $medcount));
1072
#1
– /var/www/vhosts/mysurveyhosting.com/httpdocs/templatedemo/application/helpers/admin/statistics_helper.php(3130): statistics_helper->buildOutputList("K429695X49X1751SQ001", "en", "429695", "html", ...)
3125 //loop through all selected questions
3126 foreach ($runthrough as $rt)
3127 {
3128
3129 //Step 1: Get information about this response field (SGQA) for the summary
3130 $outputs=$this->buildOutputList($rt, $language, $surveyid, $outputType, $sql, $statlang,$browse);
3131 $statisticsoutput .= $outputs['statisticsoutput'];
3132 //2. Collect and Display results #######################################################################
3133 if (isset($outputs['alist']) && $outputs['alist']) //Make sure there really is an answerlist, and if so:
3134 {
3135 $display=$this->displayResults($outputs, $results, $rt, $outputType, $surveyid, $sql, $usegraph, $browse, $statlang);
#2
– /var/www/vhosts/mysurveyhosting.com/httpdocs/templatedemo/application/controllers/Statistics_userController.php(440): statistics_helper->generate_statistics("429695", array("429695X46X1749SQ001", "429695X46X1749SQ002", "429695X46X1749SQ003", "429695X46X1720SQ001", ...), array("429695X46X1749SQ001", "429695X46X1749SQ002", "429695X46X1749SQ003", "429695X46X1720SQ001", ...), 1, ...)
435 $prb->moveStep($process_status);
436
437 } // end foreach -> loop through all questions
438
439 $helper = new statistics_helper();
440 $statisticsoutput .= $helper->generate_statistics($iSurveyID, $summary, $summary, $publicgraphs, 'html', null,$language,false);
441
442 } //end if -> show summary results
443
444 $data['statisticsoutput']=$statisticsoutput;
445 //done! set progress bar to 100%
#3
unknown(0): Statistics_userController->actionAction("429695", "en")
#4

  • /var/www/vhosts/mysurveyhosting.com/httpdocs/templatedemo/framework/web/actions/CAction.php(107): ReflectionMethod->invokeArgs(Statistics_userController, array("429695", "en"))
    #5
  • /var/www/vhosts/mysurveyhosting.com/httpdocs/templatedemo/framework/web/actions/CInlineAction.php(48): CAction->runWithParamsInternal(Statistics_userController, ReflectionMethod, array("surveyid" => "429695", "language" => "en"))
    #6
  • /var/www/vhosts/mysurveyhosting.com/httpdocs/templatedemo/framework/web/CController.php(309): CInlineAction->runWithParams(array("surveyid" => "429695", "language" => "en"))
    #7
  • /var/www/vhosts/mysurveyhosting.com/httpdocs/templatedemo/framework/web/CController.php(287): CController->runAction(CInlineAction)
    #8
  • /var/www/vhosts/mysurveyhosting.com/httpdocs/templatedemo/framework/web/CController.php(266): CController->runActionWithFilters(CInlineAction, array())
    #9
  • /var/www/vhosts/mysurveyhosting.com/httpdocs/templatedemo/framework/web/CWebApplication.php(276): CController->run("action")
    #10
  • /var/www/vhosts/mysurveyhosting.com/httpdocs/templatedemo/framework/web/CWebApplication.php(135): CWebApplication->runController("statistics_user/action/surveyid/429695/language/en")
    #11
  • /var/www/vhosts/mysurveyhosting.com/httpdocs/templatedemo/framework/base/CApplication.php(162): CWebApplication->processRequest()
    #12
  • /var/www/vhosts/mysurveyhosting.com/httpdocs/templatedemo/index.php(178): CApplication->run()
TagsNo tags attached.
Attached Files
Bug heat4
Complete LimeSurvey version number (& build)130708
I will donate to the project if issue is resolvedNo
BrowserChrome
Database type & version5.1.66
Server OS (if known)ubuntu4.20
Webserver software & version (if known)Apache 2
PHP VersionVersion 5.3.2-1ubuntu4.20

Users monitoring this issue

There are no users monitoring this issue.

Activities

DenisChenu

DenisChenu

2013-08-22 13:04

developer   ~26047

This fix miscalculation in quartile ...

c_schmitz

c_schmitz

2013-09-23 13:27

administrator   ~26325

Version 2.00+ Build 130923 released

Issue History

Date Modified Username Field Change
2013-08-06 11:37 Mazi New Issue
2013-08-06 11:37 Mazi Status new => assigned
2013-08-06 11:37 Mazi Assigned To => DenisChenu
2013-08-06 11:37 Mazi File Added: survey_archive_429695.lsa
2013-08-06 11:39 Mazi Steps to Reproduce Updated
2013-08-22 13:04 DenisChenu Note Added: 26047
2013-08-22 13:04 DenisChenu Status assigned => resolved
2013-08-22 13:04 DenisChenu Fixed in Version => 2.00+
2013-08-22 13:04 DenisChenu Resolution open => fixed
2013-09-23 13:27 c_schmitz Note Added: 26325
2013-09-23 13:27 c_schmitz Status resolved => closed