fix: [galaxy] GalaxyClusterRelation doesn't have Org and Orgc

pull/7050/head
Jakub Onderka 2021-02-19 22:43:38 +01:00
parent 7b3be9362b
commit 170ea2c64d
3 changed files with 6 additions and 9 deletions

View File

@ -4669,8 +4669,7 @@ class EventsController extends AppController
$this->loadModel('GalaxyCluster');
$clusters = $this->GalaxyCluster->fetchGalaxyClusters($this->Auth->user(), array('conditions' => array('GalaxyCluster.id' => $clusterIds)), $full=true);
App::uses('ClusterRelationsGraphTool', 'Tools');
$grapher = new ClusterRelationsGraphTool();
$grapher->construct($this->Auth->user(), $this->GalaxyCluster);
$grapher = new ClusterRelationsGraphTool($this->Auth->user(), $this->GalaxyCluster);
$relations = $grapher->getNetwork($clusters, $keepNotLinkedClusters=true, $includeReferencingRelation=true);
if ($this->_isRest()) {
return $this->RestResponse->viewData($relations, $this->response->type());

View File

@ -586,8 +586,7 @@ class GalaxiesController extends AppController
'conditions' => array('Galaxy.id' => $galaxyId)
));
App::uses('ClusterRelationsGraphTool', 'Tools');
$grapher = new ClusterRelationsGraphTool();
$grapher->construct($this->Auth->user(), $this->Galaxy->GalaxyCluster);
$grapher = new ClusterRelationsGraphTool($this->Auth->user(), $this->Galaxy->GalaxyCluster);
$relations = $grapher->getNetwork($clusters);
if ($this->_isRest()) {
return $this->RestResponse->viewData($relations, $this->response->type());

View File

@ -1,15 +1,14 @@
<?php
class ClusterRelationsGraphTool
{
private $GalaxyCluster = false;
private $user = false;
private $GalaxyCluster;
private $user;
private $lookup = array();
public function construct($user, $GalaxyCluster)
public function __construct(array $user, GalaxyCluster $GalaxyCluster)
{
$this->GalaxyCluster = $GalaxyCluster;
$this->user = $user;
return true;
}
/**
@ -75,7 +74,7 @@
'conditions' => array(
'referenced_galaxy_cluster_uuid' => $cluster['GalaxyCluster']['uuid']
),
'contain' => array('Org', 'Orgc', 'SharingGroup'),
'contain' => array('SharingGroup'),
));
if (!empty($referencingRelations)) {
foreach ($referencingRelations as $relation) {