ObjectsTableService: Fix blacklist check to target inheriting host for inherited services
Some checks failed
L10n Update / update (push) Has been cancelled
PHP Tests / Static analysis for php 7.2 on ubuntu-latest (push) Has been cancelled
PHP Tests / Static analysis for php 7.3 on ubuntu-latest (push) Has been cancelled
PHP Tests / Static analysis for php 7.4 on ubuntu-latest (push) Has been cancelled
PHP Tests / Static analysis for php 8.0 on ubuntu-latest (push) Has been cancelled
PHP Tests / Static analysis for php 8.1 on ubuntu-latest (push) Has been cancelled
PHP Tests / Static analysis for php 8.2 on ubuntu-latest (push) Has been cancelled
PHP Tests / Static analysis for php 8.3 on ubuntu-latest (push) Has been cancelled
PHP Tests / Unit tests with php 8.2 on ubuntu-latest (push) Has been cancelled
PHP Tests / Unit tests with php 8.3 on ubuntu-latest (push) Has been cancelled

This commit is contained in:
raviks789 2025-05-21 11:56:42 +02:00 committed by Ravi Kumar Kempapura Srinivasa
parent 76c3661ec9
commit 705631d79d

View file

@ -198,12 +198,32 @@ class ObjectsTableService extends ObjectsTable
['h' => 'icinga_host'],
'o.host_id = h.id',
[]
)->joinLeft(
['hsb' => 'icinga_host_service_blacklist'],
'hsb.service_id = o.id AND hsb.host_id = o.host_id',
[]
)->where('o.service_set_id IS NULL')
->group(['o.id', 'h.id','hsb.service_id', 'hsb.host_id'])
);
if ($this->inheritedBy) {
$subQuery->joinLeft(
['hi' => 'icinga_host_inheritance'],
'h.id = hi.parent_host_id',
[]
)->joinLeft(
['hc' => 'icinga_host'],
'hi.host_id = hc.id',
[]
)->joinLeft(
['hsb' => 'icinga_host_service_blacklist'],
'hsb.service_id = o.id AND hsb.host_id = hc.id',
[]
)->where('hc.id = ?', $this->inheritedBy->get('id'));
} else {
$subQuery->joinLeft(
['hsb' => 'icinga_host_service_blacklist'],
'hsb.service_id = o.id AND hsb.host_id = o.host_id',
[]
);
}
$subQuery->where('o.service_set_id IS NULL')
->group(['o.id', 'h.id', 'o.object_name', 'h.object_name', 'hsb.service_id', 'hsb.host_id'])
->order('o.object_name')->order('h.object_name');
if ($this->branchUuid) {