mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-27 07:44:04 +02:00
Add missing return to IdoQuery::getCustomvarColumnName()
Some filter combinations still seem to not work properly. refs #9692
This commit is contained in:
parent
5478027855
commit
4522cf5090
@ -496,6 +496,7 @@ abstract class IdoQuery extends DbQuery
|
|||||||
in_array($filter->getColumn(), $this->columnsWithoutCollation)
|
in_array($filter->getColumn(), $this->columnsWithoutCollation)
|
||||||
&& strpos($filter->getColumn(), 'LOWER') !== 0
|
&& strpos($filter->getColumn(), 'LOWER') !== 0
|
||||||
) {
|
) {
|
||||||
|
$filter->setColumn('LOWER(' . $filter->getColumn() . ')');
|
||||||
$filter->setColumn('LOWER(' . $filter->getColumn() . ')');
|
$filter->setColumn('LOWER(' . $filter->getColumn() . ')');
|
||||||
$expression = $filter->getExpression();
|
$expression = $filter->getExpression();
|
||||||
if (is_array($expression)) {
|
if (is_array($expression)) {
|
||||||
@ -855,7 +856,6 @@ abstract class IdoQuery extends DbQuery
|
|||||||
protected function customvarNameToTypeName($customvar)
|
protected function customvarNameToTypeName($customvar)
|
||||||
{
|
{
|
||||||
$customvar = strtolower($customvar);
|
$customvar = strtolower($customvar);
|
||||||
// TODO: Improve this:
|
|
||||||
if (! preg_match('~^_(host|service)_([a-zA-Z0-9_]+)$~', $customvar, $m)) {
|
if (! preg_match('~^_(host|service)_([a-zA-Z0-9_]+)$~', $customvar, $m)) {
|
||||||
throw new ProgrammingError(
|
throw new ProgrammingError(
|
||||||
'Got invalid custom var: "%s"',
|
'Got invalid custom var: "%s"',
|
||||||
@ -870,11 +870,19 @@ abstract class IdoQuery extends DbQuery
|
|||||||
return array_key_exists($name, $this->joinedVirtualTables);
|
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)
|
protected function getCustomvarColumnName($customvar)
|
||||||
{
|
{
|
||||||
if (isset($this->customVars[($customvar = strtolower($customvar))])) {
|
if (isset($this->customVars[($customvar = strtolower($customvar))])) {
|
||||||
$this->customVars[strtolower($customvar)] . '.varvalue';
|
return $this->customVars[$customvar] . '.varvalue';
|
||||||
}
|
}
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function aliasToColumnName($alias)
|
public function aliasToColumnName($alias)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user