From 580887c240c3cac1fab95e8936d6954c24a1b5ad Mon Sep 17 00:00:00 2001
From: Stefan Froemken <froemken@gmail.com>
Date: Wed, 5 Feb 2020 15:29:09 +0100
Subject: [PATCH] [BUGFIX] Add missing identify fields for f:hidden VH

When using only f:hidden fields for sub-properties
of a domain model which has to be updated, no identity
fields (__identity) are generated in HTML which
results in creating new model instead of updating it.

Resolves: #90331
Releases: master, 9.5
Change-Id: Ic14478a682a98bb96c27567da23b69da359cb726
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/63177
Reviewed-by: Daniel Goerz <daniel.goerz@posteo.de>
Reviewed-by: Oliver Bartsch <bo@cedev.de>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Reviewed-by: Susanne Moog <look@susi.dev>
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Susanne Moog <look@susi.dev>
---
 .../sysext/fluid/Classes/ViewHelpers/Form/HiddenViewHelper.php  | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/typo3/sysext/fluid/Classes/ViewHelpers/Form/HiddenViewHelper.php b/typo3/sysext/fluid/Classes/ViewHelpers/Form/HiddenViewHelper.php
index 0ee74800c2d9..5dc7aeee0bf5 100644
--- a/typo3/sysext/fluid/Classes/ViewHelpers/Form/HiddenViewHelper.php
+++ b/typo3/sysext/fluid/Classes/ViewHelpers/Form/HiddenViewHelper.php
@@ -62,6 +62,8 @@ class HiddenViewHelper extends \TYPO3\CMS\Fluid\ViewHelpers\Form\AbstractFormFie
         $this->tag->addAttribute('name', $name);
         $this->tag->addAttribute('value', $this->getValueAttribute());
 
+        $this->addAdditionalIdentityPropertiesIfNeeded();
+
         return $this->tag->render();
     }
 }
-- 
GitLab