Skip to content

Commit

Permalink
Fixed issue #17298: queXML PDF Export: 500: Internal Server Error (#1902
Browse files Browse the repository at this point in the history
)
  • Loading branch information
adamzammit committed Jun 1, 2021
1 parent b142959 commit 3941ba9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion application/helpers/export_helper.php
Expand Up @@ -1758,8 +1758,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 = Yii::app()->db->createCommand()
->select('MAX(CHAR_LENGTH(code)) as sc')
->select('MAX(' . $sqllength . '(code)) as sc')
->from("{{answers}}")
->where(" qid=:qid AND language=:language", array(':qid'=>$qid, ':language'=>$quexmllang))
->queryRow();
Expand Down

0 comments on commit 3941ba9

Please sign in to comment.