chg: [galaxyCluster:relationsTreeTool] Ignore duplicated cluster UUIDs

- Some default clusters have the same UUID. They are the same entity but
stored in a different cluster package. It should be addressed in the
future
pull/6624/head
mokaddem 2020-11-25 08:16:06 +01:00
parent 311cb85abd
commit 2681138b88
No known key found for this signature in database
GPG Key ID: 164C473F627A06FA
1 changed files with 3 additions and 1 deletions

View File

@ -20,6 +20,7 @@
*/
public function getTree(array $cluster)
{
$relationCache = []; // Needed as some default clusters have the same UUID
$treeRight = array(array(
'GalaxyCluster' => $cluster['GalaxyCluster'],
'children' => array()
@ -48,7 +49,8 @@
));
if (!empty($cluster['GalaxyCluster']['TargetingClusterRelation'])) {
foreach ($cluster['GalaxyCluster']['TargetingClusterRelation'] as $relation) {
if (isset($relation['GalaxyCluster'])) { // not set if cluster is unkown
if (isset($relation['GalaxyCluster']) && !isset($relationCache[$relation['GalaxyCluster']['uuid']])) { // not set if cluster is unkown
$relationCache[$relation['GalaxyCluster']['uuid']] = true;
$tmp = array(
'Relation' => array_diff_key($relation, array_flip(array('GalaxyCluster'))),
'children' => array(