[TYPO3-mvc] T3 6.2 Exception while property mapping / CONFIGURATION_CREATION_ALLOWED
g4-lisz at tonarchiv.ch
g4-lisz at tonarchiv.ch
Fri Aug 22 13:31:25 CEST 2014
Hi there
I have some issue with a action controller when updating data from a
form viewhelper.
The extension worked in 4.6. Now I get this '#1297759968: Exception
while property mapping at property path "type":Creation of objects not
allowed. To enable this, you need to set the
PropertyMappingConfiguration Value "CONFIGURATION_CREATION_ALLOWED" to
TRUE' error.
"Type" is derived from the AbstractValueObject class. It's a property of
the new object "newPdfbericht" to be added, and it is selected by radio
buttons:
<f:form enctype="multipart/form-data"
action="qualitaetsberichteUpdate" name="newPdfbericht"
object="{newPdfbericht}">
<f:form.upload name="file"/>
....
<f:for each="{pdfberichtTypes}" as="pdfberichtType">
<label>
<f:form.radio property="type"
value="{pdfberichtType}"/>
{pdfberichtType.name}
<br />
</label>
</f:for>
</f:form>
$pdfberichtTypes = $this->pdfberichtTypeRepository->findAll();
The rendered HTML for the radio form field looks like this:
<label>
<input type="radio" value="1"
name="tx_hplusinfo_pa_qualitaetsberichte[newPdfbericht][type][__identity]">
Struktur H+
<br>
<label>
<input type="radio" value="2"
name="tx_hplusinfo_pa_qualitaetsberichte[newPdfbericht][type][__identity]">
eigene Struktur
<br>
</label>
I don't understand why the property mapper has to create a new "Type"
object...
Nevertheless, I added this intialieze function to the controller:
/**
* @return void
*/
protected function initializeQualitaetsberichteUpdateAction() {
$propertyMappingConfiguration =
$this->arguments['newPdfbericht']->getPropertyMappingConfiguration();
$propertyMappingConfiguration->allowAllProperties()
->setTypeConverterOption('TYPO3\CMS\Extbase\Property\TypeConverter\PersistentObjectConverter',
\TYPO3\CMS\Extbase\Property\TypeConverter\PersistentObjectConverter::CONFIGURATION_CREATION_ALLOWED,
TRUE);
}
But still the same error. What I'm doing wrong? Maybe a TCA issue of
PpdfberichetType" or "PdfBericht"?
Any help would be much appreciated! I'm really stuck here...
Cheers,
Till
More information about the TYPO3-project-typo3v4mvc
mailing list