From ec55c63ea34c516b56169a6a235f2df1deb5c06e Mon Sep 17 00:00:00 2001 From: Carsten Schmitz Date: Fri, 22 Oct 2021 09:03:01 +0200 Subject: [PATCH] Fixed issue: Simple statistics breaking if survey contains a free text question --- application/helpers/admin/statistics_helper.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/application/helpers/admin/statistics_helper.php b/application/helpers/admin/statistics_helper.php index 92b515a597a..714735e7ced 100644 --- a/application/helpers/admin/statistics_helper.php +++ b/application/helpers/admin/statistics_helper.php @@ -2004,7 +2004,8 @@ protected function displaySimpleResults($outputs, $results, $rt, $outputType, $s //-------------------------- PCHART OUTPUT ---------------------------- list(, $qgid, $qqid) = explode("X", $rt, 3); - $aattr = QuestionAttribute::model()->getQuestionAttributes($outputs['parentqid']); + $attrQid = $outputs['parentqid'] > 0 ? $outputs['parentqid'] : $qqid; // use parentqid if exists + $aattr = QuestionAttribute::model()->getQuestionAttributes($attrQid); //PCHART has to be enabled and we need some data //