From b35b6b84cc36cb80ec0083d3e3ed5564fb2c3ff4 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Tue, 20 Sep 2022 12:03:00 +0200 Subject: [PATCH] TableWithBranchSupport: do not branchify relations --- library/Director/Web/Table/TableWithBranchSupport.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/library/Director/Web/Table/TableWithBranchSupport.php b/library/Director/Web/Table/TableWithBranchSupport.php index bcf5a151..903bd85f 100644 --- a/library/Director/Web/Table/TableWithBranchSupport.php +++ b/library/Director/Web/Table/TableWithBranchSupport.php @@ -22,12 +22,16 @@ trait TableWithBranchSupport $result = [ 'uuid' => 'COALESCE(o.uuid, bo.uuid)' ]; - $ignore = ['o.id']; + $ignore = ['o.id', 'os.id', 'o.service_set_id', 'os.host_id']; foreach ($columns as $alias => $column) { if (substr($column, 0, 2) === 'o.' && ! in_array($column, $ignore)) { // bo.column, o.column $column = "COALESCE(b$column, $column)"; } + if (substr($column, 0, 3) === 'os.' && ! in_array($column, $ignore)) { + // bo.column, o.column + $column = "COALESCE(b$column, $column)"; + } // Used in Service Tables: if ($column === 'h.object_name' && $alias = 'host') {