[BUGFIX] Invalid reference count on storing new child records in FlexForm 45/37345/2
authorOliver Hader <oliver@typo3.org>
Sat, 28 Feb 2015 15:08:45 +0000 (16:08 +0100)
committerWouter Wolters <typo3@wouterwolters.nl>
Sun, 1 Mar 2015 15:28:27 +0000 (16:28 +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/37345
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/core/Classes/DataHandling/DataHandler.php

index b8f2751..7e7867d 100644 (file)
@@ -5284,6 +5284,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)) {