Skip to content

Commit

Permalink
Fixed issue #14954: Charts in Statistics are not showing completely
Browse files Browse the repository at this point in the history
  • Loading branch information
dominikvitt committed Jun 4, 2019
1 parent 6f2d32c commit f933cea
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions application/helpers/admin/statistics_helper.php
Expand Up @@ -2165,6 +2165,7 @@ protected function displayResults($outputs, $results, $rt, $outputType, $surveyi
$sDatabaseType = Yii::app()->db->getDriverName();
$tempdir = Yii::app()->getConfig("tempdir");
$astatdata = array();
$TotalIncomplete = 0;

$sColumnName = null;

Expand Down Expand Up @@ -3400,6 +3401,11 @@ protected function displayResults($outputs, $results, $rt, $outputType, $surveyi
// Labels for graphs
$iMaxLabelLength = 0;

// add "Not completed or Not displayed" label if missing
if ($_POST['noncompleted'] == 0 && count($labels) > count($aGraphLabels)){

This comment has been minimized.

Copy link
@Shnoulle

Shnoulle Jun 4, 2019

Collaborator

$_POST['noncompleted'] ?
With debug=0 : no noncompleted in $_POST : $_POST['noncompleted'] == 0 === true It's what you want ?

then : for debug>0 !App()->getRequest()->getPost('noncompleted') , no ?

This comment has been minimized.

Copy link
@Shnoulle

Shnoulle Jun 4, 2019

Collaborator

Arg number of isset($_POST) but more $_POST[$pv] without checking … in this helper … 😱 You're courageous …

This comment has been minimized.

Copy link
@dominikvitt

dominikvitt Jun 4, 2019

Author Contributor

That is strange, "noncompleted" is a part of the form so it should always be there.
But no problem, I'll add it now.

This comment has been minimized.

Copy link
@Shnoulle

Shnoulle Jun 4, 2019

Collaborator

I see this : i didn't say it happen :).

I think it's bet to always use App()->getRequest()->getPost :) .

But right : all statistics_helper is broken …

$aGraphLabels[] = gT("Not completed or Not displayed");
}

foreach ($aGraphLabels as $key => $label) {
$cleanLabel = $label;
$cleanLabel = viewHelper::flatEllipsizeText($cleanLabel, true, 20);
Expand Down

0 comments on commit f933cea

Please sign in to comment.