[BUGFIX] FormEngine: Don't resolve IRRE children for new records 62/43562/4
authorMorton Jonuschat <m.jonuschat@mojocode.de>
Fri, 25 Sep 2015 08:37:53 +0000 (10:37 +0200)
committerFrank Nägler <frank.naegler@typo3.org>
Fri, 25 Sep 2015 09:34:20 +0000 (11:34 +0200)
When creating new records the Inline data provider tries to resolve
child records for a NEWhash uid, leading to RelationHandler returning
all possible children.

Skip resolving children for records that have a NEWhash local UID.

Resolves: #70102
Releases: master
Change-Id: I96ac6188cfe360fdee949a38c5eaf25cb6698c5d
Reviewed-on: http://review.typo3.org/43562
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
Reviewed-by: Frank Nägler <frank.naegler@typo3.org>
Tested-by: Frank Nägler <frank.naegler@typo3.org>
typo3/sysext/backend/Classes/Form/FormDataProvider/TcaInline.php

index 0cd1235..819a1da 100644 (file)
@@ -20,6 +20,7 @@ use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;
 use TYPO3\CMS\Core\Database\RelationHandler;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Core\Utility\MathUtility;
+use TYPO3\CMS\Core\Utility\StringUtility;
 
 /**
  * Resolve and prepare inline data.
@@ -112,6 +113,10 @@ class TcaInline extends AbstractItemProvider implements FormDataProviderInterfac
                $localFieldcontent = $result['databaseRow'][$fieldName];
                $directlyConnectedIds = GeneralUtility::trimExplode(',', $localFieldcontent);
 
+               if (StringUtility::beginsWith((string)$localUid, 'NEW')) {
+                       return $result;
+               }
+
                if (empty($localTca['config']['MM'])) {
                        $localUid = $this->getLiveDefaultId($localTable, $localUid);
                }