minor fix orphans while no pandora node

Former-commit-id: a9f053624ba5c38a08c3589689d4a56cfcfcff37
This commit is contained in:
fbsanchez 2019-03-22 13:04:53 +01:00
parent 0d301cd8ed
commit 80ecb58f8f

View File

@ -1976,15 +1976,21 @@ class NetworkMap
$target = $this->calculateRelations($k); $target = $this->calculateRelations($k);
// Adopt all orphan nodes but pandora one. // Adopt all orphan nodes but pandora one.
if (empty($target) && $item['id_node'] != 0) { if (empty($target)) {
$rel = []; if (isset($this->noPandoraNode) === false
$rel['id_parent'] = 0; || $this->noPandoraNode == false
$rel['id_child'] = $item['id_node']; ) {
$rel['parent_type'] = NODE_PANDORA; if ($item['id_node'] != 0) {
$rel['child_type'] = $item['node_type']; $rel = [];
$rel['id_child_source_data'] = $item['id_source_data']; $rel['id_parent'] = 0;
$rel['id_child'] = $item['id_node'];
$rel['parent_type'] = NODE_PANDORA;
$rel['child_type'] = $item['node_type'];
$rel['id_child_source_data'] = $item['id_source_data'];
$orphans[] = $rel; $orphans[] = $rel;
}
}
} else { } else {
// Flattern edges. // Flattern edges.
foreach ($target as $rel) { foreach ($target as $rel) {