Skip to content

Commit

Permalink
Using Advanced Many-To-Many Relation in Field-Collections leads to 50…
Browse files Browse the repository at this point in the history
…0 error in DataHub #385
  • Loading branch information
weisswurstkanone committed Jul 5, 2021
1 parent 7499b74 commit 6d878ec
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/GraphQL/DataObjectType/MultihrefMetadataType.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
use Pimcore\Bundle\DataHubBundle\GraphQL\Service;
use Pimcore\Bundle\DataHubBundle\GraphQL\Traits\ServiceTrait;
use Pimcore\Model\DataObject\ClassDefinition\Data;
use Pimcore\Model\DataObject\Fieldcollection\Definition;

class MultihrefMetadataType extends ObjectType
{
Expand All @@ -47,7 +48,9 @@ public function __construct(Service $graphQlService, Data $fieldDefinition = nul
$this->class = $class;
$this->setGraphQlService($graphQlService);
$this->fieldDefinition = $fieldDefinition;
$config['name'] = 'object_'.$class->getName().'_'.$fieldDefinition->getName();
$name = ($class instanceof Definition || $class instanceof \Pimcore\Model\DataObject\Objectbrick\Definition) ? $class->getKey() : $class->getName();

$config['name'] = 'object_'.$name.'_'.$fieldDefinition->getName();
$this->build($config);
parent::__construct($config);
}
Expand Down

0 comments on commit 6d878ec

Please sign in to comment.