Add missing return to IdoQuery::getCustomvarColumnName()

Some filter combinations still seem to not work properly.

refs #9692
This commit is contained in:
Eric Lippmann 2015-07-21 15:27:01 +02:00
parent 5478027855
commit 4522cf5090
1 changed files with 10 additions and 2 deletions

View File

@ -496,6 +496,7 @@ abstract class IdoQuery extends DbQuery
in_array($filter->getColumn(), $this->columnsWithoutCollation)
&& strpos($filter->getColumn(), 'LOWER') !== 0
) {
$filter->setColumn('LOWER(' . $filter->getColumn() . ')');
$filter->setColumn('LOWER(' . $filter->getColumn() . ')');
$expression = $filter->getExpression();
if (is_array($expression)) {
@ -855,7 +856,6 @@ abstract class IdoQuery extends DbQuery
protected function customvarNameToTypeName($customvar)
{
$customvar = strtolower($customvar);
// TODO: Improve this:
if (! preg_match('~^_(host|service)_([a-zA-Z0-9_]+)$~', $customvar, $m)) {
throw new ProgrammingError(
'Got invalid custom var: "%s"',
@ -870,11 +870,19 @@ abstract class IdoQuery extends DbQuery
return array_key_exists($name, $this->joinedVirtualTables);
}
/**
* Get the query column of a custom variable or null in case the custom variable has not been joined
*
* @param string $customvar
*
* @return null|string
*/
protected function getCustomvarColumnName($customvar)
{
if (isset($this->customVars[($customvar = strtolower($customvar))])) {
$this->customVars[strtolower($customvar)] . '.varvalue';
return $this->customVars[$customvar] . '.varvalue';
}
return null;
}
public function aliasToColumnName($alias)