DbRepository: Consider a filter column without query context as a statement column
Feels wrong..somehow, but it works. refs #8826
This commit is contained in:
parent
2c9af2fb81
commit
5e0ae6410b
|
@ -529,7 +529,7 @@ abstract class DbRepository extends Repository implements Extensible, Updatable,
|
|||
* @param string $table The table where to look for the column or alias
|
||||
* @param string $name The name or alias of the column to validate
|
||||
* @param RepositoryQuery $query An optional query to pass as context,
|
||||
* if not given no join will be attempted
|
||||
* if not given the column is considered being used for a statement filter
|
||||
*
|
||||
* @return string The given column's name
|
||||
*
|
||||
|
@ -537,7 +537,11 @@ abstract class DbRepository extends Repository implements Extensible, Updatable,
|
|||
*/
|
||||
public function requireFilterColumn($table, $name, RepositoryQuery $query = null)
|
||||
{
|
||||
if ($query === null || $this->validateQueryColumnAssociation($table, $name)) {
|
||||
if ($query === null) {
|
||||
return $this->requireStatementColumn($table, $name);
|
||||
}
|
||||
|
||||
if ($this->validateQueryColumnAssociation($table, $name)) {
|
||||
return parent::requireFilterColumn($table, $name, $query);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue