Skip to content

Commit

Permalink
[TASK] Remove FieldTypeRegistry dependency from ContentBlockDataDecor…
Browse files Browse the repository at this point in the history
…ator
  • Loading branch information
nhovratov committed Oct 8, 2024
1 parent 44a7c0d commit 986eddf
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions Classes/DataProcessing/ContentBlockDataDecorator.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ public function __construct(
private readonly GridProcessor $gridProcessor,
private readonly ContentObjectProcessor $contentObjectProcessor,
private readonly ContentTypeResolver $contentTypeResolver,
private readonly FieldTypeRegistry $fieldTypeRegistry,
) {}

public function setRequest(ServerRequestInterface $request): void
Expand Down Expand Up @@ -85,12 +84,11 @@ private function buildContentBlockDataObjectRecursive(
foreach ($contentTypeDefinition->getColumns() as $column) {
$tcaFieldDefinition = $tableDefinition->getTcaFieldDefinitionCollection()->getField($column);
$fieldType = $tcaFieldDefinition->getFieldType();
$fieldTypeService = $this->fieldTypeRegistry->get($fieldType::class);
if (SpecialFieldType::tryFrom($fieldTypeService->getName()) !== null) {
if (SpecialFieldType::tryFrom($fieldType->getName()) !== null) {
continue;
}
// TCA type "passthrough" is not available in the record, and it won't fall back to raw record value.
if ($fieldTypeService->getTcaType() === 'passthrough') {
if ($fieldType->getTcaType() === 'passthrough') {
$resolvedField = $resolvedRelation->record->getRawRecord()->get($tcaFieldDefinition->getUniqueIdentifier());
} else {
$resolvedField = $resolvedRelation->record->get($tcaFieldDefinition->getUniqueIdentifier());
Expand Down

0 comments on commit 986eddf

Please sign in to comment.