[BUGFIX] Invalid reference count on storing new child records in FlexForm 46/37346/2
authorOliver Hader <oliver@typo3.org>
Sat, 28 Feb 2015 15:08:45 +0000 (16:08 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Mon, 2 Mar 2015 12:05:17 +0000 (13:05 +0100)
If creating a new parent record that contains inline child
records as part of a FlexForm configuration, the resulting
reference count is the temporary "NEW..." identifier. The
expected result is to have the number of child references
in that case as well.

Resolves: #58307
Releases: master, 6.2
Change-Id: I36a4dd06a38ad5d9f197190658b97f8a3b5fa234
Reviewed-on: http://review.typo3.org/37346
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/core/Classes/DataHandling/DataHandler.php

index 488732b..b5c9a69 100644 (file)
@@ -17,6 +17,7 @@ namespace TYPO3\CMS\Core\DataHandling;
 use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\Database\DatabaseConnection;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
+use TYPO3\CMS\Core\Utility\MathUtility;
 use TYPO3\CMS\Core\Versioning\VersionState;
 
 /**
@@ -5317,6 +5318,11 @@ class DataHandler {
         */
        protected function updateFlexFormData($flexFormId, array $modifications) {
                list ($table, $uid, $field) = explode(':', $flexFormId, 3);
+
+               if (!MathUtility::canBeInterpretedAsInteger($uid) && !empty($this->substNEWwithIDs[$uid])) {
+                       $uid = $this->substNEWwithIDs[$uid];
+               }
+
                $record = $this->recordInfo($table, $uid, '*');
 
                if (!$table || !$uid || !$field || !is_array($record)) {