FIX postgres can filter on non text fields

This issue causes the comparison to fail if comparing a non text fields (for example, a date or integer). This will cause the CMS to fail in places such as Gridfield selector. 

Similar fix as this one: https://github.com/silverstripe/silverstripe-framework/pull/2242 The difference being comparisonClause(...) being more apt solution in SS 3.1
This commit is contained in:
torleif 2014-04-08 13:24:05 +12:00
parent 4ca243fc68
commit 7626d74bee
1 changed files with 1 additions and 0 deletions

View File

@ -2108,6 +2108,7 @@ class PostgreSQLDatabase extends SS_Database {
} else {
$comp = ($caseSensitive === true) ? 'LIKE' : 'ILIKE';
if($negate) $comp = 'NOT ' . $comp;
$field.='::text';
}
return sprintf("%s %s '%s'", $field, $comp, $value);