initializeResultArray(); if (!isset($this->data['renderData']['fieldInformation'])) { return $result; } $fieldInformation = $this->data['renderData']['fieldInformation']; $orderedFieldInformation = $this->dependencyOrderingService->orderByDependencies($fieldInformation); foreach ($orderedFieldInformation as $anOrderedFieldInformation => $orderedFieldInformationConfiguration) { if (isset($orderedFieldInformationConfiguration['disabled']) && $orderedFieldInformationConfiguration['disabled'] || !isset($fieldInformation[$anOrderedFieldInformation]['renderType']) ) { // Don't consider this control if disabled. // Also ignore if renderType is not given. // Missing renderType may happen if an element registers a default field control // as disabled, and TCA enabled that. If then additionally for instance the // element renderType is changed to an element that doesn't register the control // by default anymore, this would then fatal if we don't continue here. // @todo: the above scenario indicates a small configuration flaw, maybe log an error somewhere? continue; } $options = $this->data; $options['renderType'] = $fieldInformation[$anOrderedFieldInformation]['renderType']; $options['renderData']['fieldInformationOptions'] = $orderedFieldInformationConfiguration['options'] ?? []; $informationResult = $this->nodeFactory->create($options)->render(); $allowedTags = '

'; if (strip_tags($informationResult['html'], $allowedTags) !== $informationResult['html']) { throw new \RuntimeException( 'The field information API supports only a limited number of HTML tags within the result' . ' HTML of children. Allowed tags are: "' . $allowedTags . '" Child' . ' ' . $options['renderType'] . ' violated this rule. Either remove offending tags or' . ' switch to a different API like "fieldWizard" or "fieldControl".', 1485084419 ); } $result = $this->mergeChildReturnIntoExistingResult($result, $informationResult); } return $result; } }