Skip to content

Commit

Permalink
Fixed issue #14182: Database error when trying to define a quota
Browse files Browse the repository at this point in the history
  • Loading branch information
dominikvitt committed Nov 16, 2018
1 parent b61f1ff commit 49f76c6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions application/models/Survey.php
Expand Up @@ -1834,8 +1834,12 @@ private function getQuestionOrderCriteria()
$criteria->with = array(
'survey.groups',
);
$criteria->order = Yii::app()->db->quoteColumnName('groups.group_order').','
.Yii::app()->db->quoteColumnName('t.question_order');

if (Yii::app()->db->driverName == 'sqlsrv'){
$criteria->order = Yii::app()->db->quoteColumnName('t.question_order');
} else {
$criteria->order = Yii::app()->db->quoteColumnName('groups.group_order').','.Yii::app()->db->quoteColumnName('t.question_order');
}
$criteria->addCondition('groups.gid=t.gid', 'AND');
return $criteria;

Expand Down

1 comment on commit 49f76c6

@c-schmitz
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sqlsrv is not the only MSSQL driver name

Please sign in to comment.