mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-29 16:54:04 +02:00
IdoQuery: Join customvars with only live references
This commit is contained in:
parent
1092421782
commit
8779f9f175
@ -1193,14 +1193,31 @@ abstract class IdoQuery extends DbQuery
|
|||||||
|
|
||||||
$this->customVars[strtolower($customvar)] = $alias;
|
$this->customVars[strtolower($customvar)] = $alias;
|
||||||
|
|
||||||
if ($this->hasJoinedVirtualTable('services')) {
|
if ($type === 'host') {
|
||||||
$leftcol = 's.' . $type . '_object_id';
|
if (
|
||||||
} elseif ($type === 'service') {
|
$this instanceof ServicecommentQuery
|
||||||
$this->requireVirtualTable('services');
|
|| $this instanceof ServicedowntimeQuery
|
||||||
$leftcol = 's.service_object_id';
|
|| $this instanceof ServicecommenthistoryQuery
|
||||||
} else {
|
|| $this instanceof ServicedowntimestarthistoryQuery
|
||||||
$this->requireVirtualTable('hosts');
|
|| $this instanceof ServiceflappingstarthistoryQuery
|
||||||
$leftcol = 'h.host_object_id';
|
|| $this instanceof ServicegroupQuery
|
||||||
|
|| $this instanceof ServicenotificationQuery
|
||||||
|
|| $this instanceof ServicestatehistoryQuery
|
||||||
|
|| $this instanceof ServicestatusQuery
|
||||||
|
) {
|
||||||
|
$this->requireVirtualTable('services');
|
||||||
|
$leftcol = 's.host_object_id';
|
||||||
|
} else {
|
||||||
|
$leftcol = 'ho.object_id';
|
||||||
|
if (! $this->hasJoinedTable('ho')) {
|
||||||
|
$this->requireVirtualTable('hosts');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else { // $type === 'service'
|
||||||
|
$leftcol = 'so.object_id';
|
||||||
|
if (! $this->hasJoinedTable('so')) {
|
||||||
|
$this->requireVirtualTable('services');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$mapped = $this->getMappedField($leftcol);
|
$mapped = $this->getMappedField($leftcol);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user