Bug #90331

f:hidden does not add identity fields

Added by Stefan Froemken 20 days ago. Updated 20 days ago.

Status:
Under Review
Priority:
Should have
Category:
Fluid
Target version:
Start date:
2020-02-05
Due date:
% Done:

0%

TYPO3 Version:
9
PHP Version:
7.2
Tags:
Complexity:
easy
Is Regression:
Sprint Focus:

Description

Hello Core-Team,

I have following relation:

club -> 1:n -> addresses -> 1:1 -> PoiCollection

In a view I want to update the latitude and longitude properties of PoiCollection record with JavaScript. So I render them with f:hidden:

<f:form.hidden class="latitude-{data.uid}" property="club.addresses.0.latitude" value="{poiCollection.latitude}" />

This field was rendered absolutely correct, but when I try to update/save the record Extbase tries to create a NEW record instead of updating it. It needs some time, but in HTML I miss the __identity lines for that properties:

<input type="hidden" name="tx_clubdirectory_clubdirectory[club][__identity]" value="9">
<input type="hidden" name="tx_clubdirectory_clubdirectory[club][addresses][0][__identity]" value="17">
<input type="hidden" name="tx_clubdirectory_clubdirectory[club][addresses][0][txMaps2Uid][__identity]" value="26">

That's because of the missing line in f:hidden VH:

$this->addAdditionalIdentityPropertiesIfNeeded();

Stefan


Related issues

Related to TYPO3.Fluid - Bug #33274: Viewhelpers extending AbstractFormFieldViewHelper should add additionalIdentityProperties even if there is an error on the field Closed 2012-01-18
Related to TYPO3.Fluid - Bug #29290: Additional Identity Properties not set on mapping error Resolved 2011-08-26

History

#1 Updated by Gerrit Code Review 20 days ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/63177

#2 Updated by Stefan Froemken 20 days ago

  • Related to Bug #33274: Viewhelpers extending AbstractFormFieldViewHelper should add additionalIdentityProperties even if there is an error on the field added

#3 Updated by Stefan Froemken 20 days ago

  • Related to Bug #29290: Additional Identity Properties not set on mapping error added

#4 Updated by Gerrit Code Review 20 days ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/63177

Also available in: Atom PDF