#104502RecordTransformationProcessor is incompatible with f:cObject
Description
Comming from the surfcamp, I’ve tried to setup my content rendering without fluid_styled_content (not installed in project). And therefore came up with the following typoscript configuration using RecordTransformationProcessor to fetch the content elements:
# Default configuration for content elements which are using FLUIDTEMPLATE directly
lib.contentElement >
lib.contentElement = FLUIDTEMPLATE
lib.contentElement {
templateName = Default
templateRootPaths {
0 = EXT:site-distribution/Resources/Private/Templates/Content/
10 = {$content.templates.templateRootPath}
}
partialRootPaths {
0 = EXT:site-distribution/Resources/Private/Templates/Content/Partials/
10 = {$content.templates.partialRootPath}
}
layoutRootPaths {
0 = EXT:site-distribution/Resources/Private/Templates/Content/Layouts/
10 = {$content.templates.layoutRootPath}
}
dataProcessing {
5 = record-transformation
5 {
table = tt_content
as = data
}
}
}
With this configuration “data” is now of type TYPO3\CMS\Core\Domain\Record instead array (compared to the fluid_styled_content way):
clipboard-202407301429-7d9rl.png
This results in forms not being rendered as the pi_flexform values are not recogniced in the f:cObject. (See second debug which is from “Render.html” of the Forms extension).
<f:cObject typoscriptObjectPath="tt_content.{data.CType}.20" data="{data}" table="tt_content" />
For Objects the f:cObject Viewhelper calls ObjectAccess::getGettableProperties() which doesn’t resolve the pi_flexform field:
if (is_object($data)) {
$data = ObjectAccess::getGettableProperties($data);
} elseif (is_string($data) || is_numeric($data)) {
$currentValue = (string)$data;
$data = [$data];
}
https://github.com/TYPO3/typo3/blob/ca8f1f9f9240e80a222e99b7b404226f4caddf90/typo3/sysext/fluid/Classes/ViewHelpers/CObjectViewHelper.php#L132-L133
clipboard-202407301441-ulfbn.png
Possible solutions:
1. Convert Record to array for f:cObject call
2. Check for type RecordInterface and use ->toArray() in f:cObject Viewhelper
3. …
Reviews 1
Files 2
History 35
-
André Buchmann changed description 07/30/24, 12:57
-
Gerrit Code Review pushed patch set 1 for main to change 85416 status
NewUnder Review 07/30/24, 13:06 -
Gerrit Code Review pushed patch set 2 for main to change 85416 07/30/24, 17:55
-
André Buchmann commented and changed status
Under ReviewResolved done0 %100 % 08/06/24, 12:05 -
Benni Mack changed status
ResolvedClosed 10/15/24, 09:08
Applied in changeset commit:f3ce3d4d012aa6f97d6952e21797ea777aa6888e.