Skip to content

Commit 1dacd5e

Browse files
committed
[spalenque] - #13297 * fix sangria flat report for survey
1 parent 57c9e8d commit 1dacd5e

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

sangria/code/SangriaPageExportDataExtension.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ private function ExportSurveyResultsDataSurveyBuilder()
411411
WHEN 'SurveyCheckBoxListQuestionTemplate'
412412
THEN ( SELECT GROUP_CONCAT(Value SEPARATOR '|') FROM SurveyQuestionValueTemplate WHERE FIND_IN_SET(ID, SA.Value) > 0)
413413
WHEN 'SurveyRankingQuestionTemplate'
414-
THEN ( SELECT GROUP_CONCAT(Value SEPARATOR '|') FROM SurveyQuestionValueTemplate WHERE FIND_IN_SET(ID, SA.Value) > 0)
414+
THEN ( SELECT GROUP_CONCAT(Value ORDER BY FIND_IN_SET(ID, SA.Value) SEPARATOR '|') FROM SurveyQuestionValueTemplate WHERE FIND_IN_SET(ID, SA.Value) > 0)
415415
WHEN 'SurveyRadioButtonListQuestionTemplate'
416416
THEN ( SELECT GROUP_CONCAT(Value SEPARATOR '|') FROM SurveyQuestionValueTemplate WHERE FIND_IN_SET(ID, SA.Value) > 0)
417417
ELSE SA.Value END AS Answer
@@ -804,7 +804,7 @@ private function getSurveyBuilderExportData($flat_fields = array(), $flat_fields
804804
foreach($options as $o)
805805
{
806806
$index = array_search($o, $answers);
807-
$line[self::functionPrepareValueForCSV(sprintf("%s - %s", $question, $o))] = $index === false ? '0' : ($index + 1);;
807+
$line[self::functionPrepareValueForCSV(sprintf("%s - %s", $question, $o))] = $index === false ? '0' : ($index + 1);
808808
}
809809
}
810810
}

survey_builder/code/infrastructure/active_records/instances/Survey.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ protected function onBeforeWrite()
7171
parent::onBeforeWrite();
7272
if ($this->CreatedBy()->inGroup(Survey::SurveyTestersGroupSlug)) {
7373
$this->IsTest = true;
74+
} else {
75+
$this->IsTest = false;
7476
}
7577
}
7678

0 commit comments

Comments
 (0)