Fixed #673.
This commit is contained in:
parent
79b79909ad
commit
1446447107
@ -757,11 +757,11 @@ class Doctrine_Query extends Doctrine_Query_Abstract implements Countable, Seria
|
|||||||
. $this->_conn->quoteIdentifier($field);
|
. $this->_conn->quoteIdentifier($field);
|
||||||
} else {
|
} else {
|
||||||
// build sql expression
|
// build sql expression
|
||||||
|
$field = $this->getRoot()->getColumnName($field);
|
||||||
$term[0] = $this->_conn->quoteIdentifier($field);
|
$term[0] = $this->_conn->quoteIdentifier($field);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
if ( ! empty($term[0]) &&
|
if ( ! empty($term[0]) &&
|
||||||
! in_array(strtoupper($term[0]), self::$_keywords) &&
|
! in_array(strtoupper($term[0]), self::$_keywords) &&
|
||||||
! is_numeric($term[0])) {
|
! is_numeric($term[0])) {
|
||||||
@ -775,13 +775,12 @@ class Doctrine_Query extends Doctrine_Query_Abstract implements Countable, Seria
|
|||||||
$table = $this->_queryComponents[$componentAlias]['table'];
|
$table = $this->_queryComponents[$componentAlias]['table'];
|
||||||
|
|
||||||
// check column existence
|
// check column existence
|
||||||
if ($table->hasColumn($term[0])) {
|
if ($table->hasField($term[0])) {
|
||||||
$found = true;
|
$found = true;
|
||||||
|
|
||||||
|
|
||||||
$def = $table->getDefinitionOf($term[0]);
|
$def = $table->getDefinitionOf($term[0]);
|
||||||
|
|
||||||
// get the actual column name from alias
|
// get the actual column name from field name
|
||||||
$term[0] = $table->getColumnName($term[0]);
|
$term[0] = $table->getColumnName($term[0]);
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user