Skip to content

Commit 73431f6

Browse files
committed
IBX-10936: Fix circular dependency
1 parent 0333913 commit 73431f6

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/lib/ContentType/ContentTypeFieldsByExpressionService.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@
1010

1111
use Ibexa\AdminUi\Util\ContentTypeFieldsExtractorInterface;
1212
use Ibexa\Contracts\AdminUi\ContentType\ContentTypeFieldsByExpressionServiceInterface;
13+
use Ibexa\Contracts\Core\Persistence\Content\Language\Handler as ContentLanguageHandler;
1314
use Ibexa\Contracts\Core\Persistence\Content\Type\Handler as ContentTypeHandler;
1415
use Ibexa\Contracts\Core\Repository\Values\ContentType\ContentType;
1516
use Ibexa\Contracts\Core\Repository\Values\ContentType\FieldDefinition;
17+
use Ibexa\Core\FieldType\FieldTypeRegistry;
1618
use Ibexa\Core\Repository\Mapper\ContentTypeDomainMapper;
1719

1820
final class ContentTypeFieldsByExpressionService implements ContentTypeFieldsByExpressionServiceInterface
@@ -26,11 +28,17 @@ final class ContentTypeFieldsByExpressionService implements ContentTypeFieldsByE
2628
public function __construct(
2729
ContentTypeFieldsExtractorInterface $fieldsExtractor,
2830
ContentTypeHandler $contentTypeHandler,
29-
ContentTypeDomainMapper $contentTypeDomainMapper
31+
ContentLanguageHandler $contentLanguageHandler,
32+
FieldTypeRegistry $fieldTypeRegistry
3033
) {
3134
$this->fieldsExtractor = $fieldsExtractor;
3235
$this->contentTypeHandler = $contentTypeHandler;
33-
$this->contentTypeDomainMapper = $contentTypeDomainMapper;
36+
// Building ContentTypeDomainMapper manually to avoid circular dependency.
37+
$this->contentTypeDomainMapper = new ContentTypeDomainMapper(
38+
$contentTypeHandler,
39+
$contentLanguageHandler,
40+
$fieldTypeRegistry,
41+
);
3442
}
3543

3644
public function getFieldsFromExpression(string $expression): array

0 commit comments

Comments
 (0)