Skip to content

Commit

Permalink
Fixed issue #15208: MSSQL error on 2nd page of theme
Browse files Browse the repository at this point in the history
Dev: quoteColumnName("t.template_name")
Dev: t.qid and other don't seems to need it
Dev: always better to use more Yii criteria …
  • Loading branch information
Shnoulle committed Aug 29, 2019
1 parent 0dd6dfa commit 808d4bc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions application/models/TemplateConfiguration.php
Expand Up @@ -135,7 +135,7 @@ public function relations()
/** @inheritdoc */
public function defaultScope()
{
return array('order'=> $this->getTableAlias(false, false).'.template_name');
return array('order'=> Yii::app()->db->quoteColumnName($this->getTableAlias(false, false).'.template_name'));
}

/**
Expand Down Expand Up @@ -410,7 +410,7 @@ public function search()

$criteria = new CDbCriteria;

$criteria->join = 'INNER JOIN {{templates}} AS template ON t.template_name = template.name';
$criteria->join = 'INNER JOIN {{templates}} AS template ON '.Yii::app()->db->quoteColumnName("t.template_name").' = template.name';
//Don't show surveyspecifi settings on the overview
$criteria->addCondition('t.sid IS NULL');
$criteria->addCondition('t.gsid IS NULL');
Expand Down Expand Up @@ -439,7 +439,7 @@ public function searchGrid()
$pageSizeTemplateView = Yii::app()->user->getState('pageSizeTemplateView', Yii::app()->params['defaultPageSize']);
$criteria = new CDbCriteria;

$criteria->join = 'INNER JOIN {{templates}} AS template ON t.template_name = template.name';
$criteria->join = 'INNER JOIN {{templates}} AS template ON '.Yii::app()->db->quoteColumnName("t.template_name").' = template.name';
$criteria->together = true;
//Don't show surveyspecifi settings on the overview
$criteria->addCondition('t.sid IS NULL');
Expand Down

0 comments on commit 808d4bc

Please sign in to comment.