Skip to content

Commit

Permalink
Fixed issue #17219: Filter on numeric fields in response view does no…
Browse files Browse the repository at this point in the history
…t work on Postgres
  • Loading branch information
c-schmitz committed Mar 31, 2021
1 parent 37c5b1e commit dccd862
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion application/controllers/admin/responses.php
Expand Up @@ -406,7 +406,7 @@ public function browse($iSurveyId)
App()->getClientScript()->registerScriptFile(App()->getConfig('adminscripts').'listresponse.js', LSYii_ClientScript::POS_BEGIN);
App()->getClientScript()->registerScriptFile(App()->getConfig('adminscripts').'tokens.js', LSYii_ClientScript::POS_BEGIN);

// Basic datas for the view
// Basic data for the view
$aData = $this->_getData($iSurveyId);
$aData['surveyid'] = $iSurveyId;
$aData['menu']['edition'] = false;
Expand Down
2 changes: 1 addition & 1 deletion application/models/SurveyDynamic.php
Expand Up @@ -742,7 +742,7 @@ protected function filterColumns(CDbCriteria $criteria)
$columnHasValue = !empty($this->$c1);
if ($columnHasValue) {
$isDatetime = strpos($column->dbType, 'timestamp') !== false || strpos($column->dbType, 'datetime') !== false;
if ($column->dbType == 'decimal') {
if ($column->dbType == 'decimal' || substr($column->dbType, 0, 7) == 'numeric') {
$this->$c1 = (float) $this->$c1;
$criteria->compare(Yii::app()->db->quoteColumnName($c1), $this->$c1, false);
} else if ($isDatetime) {
Expand Down

0 comments on commit dccd862

Please sign in to comment.