Skip to content

Commit

Permalink
Fixed issue #17298: queXML PDF Export: 500: Internal Server Error (#1905
Browse files Browse the repository at this point in the history
)
  • Loading branch information
adamzammit committed Jun 2, 2021
1 parent ab6c7a3 commit 8646a78
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion application/helpers/export_helper.php
Expand Up @@ -1833,8 +1833,14 @@ function quexml_export($surveyi, $quexmllan, $iResponseID = false)
case "R": //RANKING STYLE
quexml_create_subQuestions($question, $qid, $sgq, $iResponseID, $fieldmap, true);

$sqllength = "CHAR_LENGTH";
$platform = Yii::app()->db->getDriverName();
if ($platform == 'mssql' || $platform == 'sqlsrv' || $platform == 'dblib') {
$sqllength = "LEN";
}

$QROW = App()->db->createCommand()
->select('MAX(CHAR_LENGTH(code)) as sc')
->select('MAX(' . $sqllength . '(code)) as sc')
->from('{{answers}} a')
->join('{{answer_l10ns}} al', 'a.aid=al.aid')
->where('a.qid=:qid AND al.language=:language', [':qid' => $qid, ':language' => $quexmllang])
Expand Down

0 comments on commit 8646a78

Please sign in to comment.