Skip to content
This repository has been archived by the owner on Dec 13, 2022. It is now read-only.

fix(clapi): fix overlapping in clapi export #8191

Merged
merged 2 commits into from
Dec 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions tests/clapi_export/clapi-configuration.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5029,6 +5029,7 @@ HOST;setparam;Centreon-Server;timezone;0
HOST;setparam;Centreon-Server;host_locked;0
HOST;setparam;Centreon-Server;host_register;1
HOST;setparam;Centreon-Server;host_activate;1
HOST;addparent;Centreon-Server;test_host
HOST;addtemplate;Centreon-Server;generic-host
HOST;addtemplate;test_host;my_htpl-test
STPL;ADD;generic-service;generic-service;
Expand Down
6 changes: 5 additions & 1 deletion www/class/centreon-clapi/centreonHost.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1297,7 +1297,11 @@ public function export($filterName = null)
echo $this->action . $this->delim
. "addparent" . $this->delim
. $element[$this->object->getUniqueLabelField()] . $this->delim
. isset($elements[$parentId]) && isset($elements[$parentId][$this->object->getUniqueLabelField()]) ? $elements[$parentId][$this->object->getUniqueLabelField()] : '' . "\n";
. ((isset($elements[$parentId]) && isset($elements[$parentId][$this->object->getUniqueLabelField()]))
? $elements[$parentId][$this->object->getUniqueLabelField()]
: ''
)
. "\n";
}
}

Expand Down