Prevent CommentQuery from doing nonsense Joins, may break some views
This commit is contained in:
parent
9cc3bb75ca
commit
edb7ea076e
|
@ -78,6 +78,7 @@ class CommentQuery extends IdoQuery
|
||||||
|
|
||||||
protected function joinHosts()
|
protected function joinHosts()
|
||||||
{
|
{
|
||||||
|
$this->conflictsWithVirtualTable('services');
|
||||||
$this->baseQuery->join(
|
$this->baseQuery->join(
|
||||||
array('ho' => $this->prefix . 'objects'),
|
array('ho' => $this->prefix . 'objects'),
|
||||||
'co.name1 = ho.name1 AND ho.is_active = 1 AND ho.objecttype_id = 1',
|
'co.name1 = ho.name1 AND ho.is_active = 1 AND ho.objecttype_id = 1',
|
||||||
|
@ -87,9 +88,10 @@ class CommentQuery extends IdoQuery
|
||||||
|
|
||||||
protected function joinServices()
|
protected function joinServices()
|
||||||
{
|
{
|
||||||
|
$this->conflictsWithVirtualTable('hosts');
|
||||||
$this->baseQuery->joinLeft(
|
$this->baseQuery->joinLeft(
|
||||||
array('so' => $this->prefix . 'objects'),
|
array('so' => $this->prefix . 'objects'),
|
||||||
'co.name1 = so.name1 AND co.name2 = so.name2 AND so.is_active = 1 AND so.objecttype_id = 2',
|
'co.name1 = so.name1 AND co.name2 = so.name2 AND so.is_active = 1 AND co.is_active = 1 AND so.objecttype_id = 2',
|
||||||
array()
|
array()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue