#61934Forms: "current" and ".field" data is not visible
Description
When using a FORM cObject, “current” value and “field” data is not visible inside the FORM object.
The following minimal code example illustrates the issue. Outside the FORM cObject, both {GP: test} and {field: test} are visible. However inside the FORM element, only {GP: test} is visible. Apparently this information is not passed on.
lib.testForm = COA
lib.testForm {
20 = TEXT
# This works.
20.data = GP : test
20.wrap = <p>GP: |</p>
30 = TEXT
# And this works.
30.data = field : test
30.wrap = <p>Field: |</p>
40 = FORM
40 {
30 = TEXT
# This also works.
30.data = GP : test
30.wrap = GP: |
40 = TEXT
# This does not work.
40.data = field : test
40.wrap = Field: |
}
}
This is the output of above typoscript:
<p>GP:31</p>
<p>Field:42</p>
<form action="test/test.html" enctype="multipart/form-data" method="post">
<ol>
<li class="csc-form-5 csc-form-element csc-form-element-content">GP:31</li>
<li class="csc-form-6 csc-form-element csc-form-element-content">Field:</li>
</ol>
</form>
As far as I can tell, the issue is that start($data, $table) is not called when creating the ContentObjectRenderer in \TYPO3\CMS\Form\Domain\Factory\TypoScriptFactory.
protected function getLocalConentObject() {
if (!isset($this->localContentObject)) {
$this->localContentObject = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Frontend\\ContentObject\\ContentObjectRenderer');
$this->localContentObject.start($data, $table); // This line is missing.
}
return $this->localContentObject;
}
The indicated statement is missing. However I don’t know where $data and $table should come from.
Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.