Additional __identity field when using TYPO3.Media
When using a <f:form.upload /> field for uploading a TYPO3.Media Image, FLUID adds a hidden _identity field for the Image which results in an "_identity mapping is not allowed" exception when saving the record. Removing the hidden __identity field by deleting
$content .= $this->renderAdditionalIdentityFields();
from FormViewHelper.php on line 127 solves the particular problem. Some further if / else conditions are needed.
Updated by Martin Keck about 9 years ago
Two remarks from my point of view (using 1.1 rc2 and TYPO3.Media) to probably make things clearer:
1. The problem only emerges when editing/updating an existing content (or whatever element) having a TYPO3.Media image as property (i. e. in newly created form there's no _identity hidden field for the image created)
2. I can confirm Michel's comment, that the suggested patch does not change anything (it's already part of rc2). The hidden field's still there, e. g. <input type="hidden" name="content[image][_identity]" value="11db8fa6-71ad-4f89-a0d3-e75c4c545412" />. Removing it from the HTML output before submitting the form leads to a correctly updated image.