[TASK] Integrate tests for DataHandler hook invocations
[Packages/TYPO3.CMS.git] / typo3 / sysext / core / Tests / Functional / DataHandling / Framework / ActionService.php
index 8e634b1..e5cf2ba 100644 (file)
@@ -138,9 +138,11 @@ class ActionService
             $recordData = $this->resolvePreviousUid($recordData, $currentUid);
             $currentUid = $recordData['uid'];
             if ($recordData['uid'] === '__NEW') {
-                $recordData['pid'] = $pageId;
                 $currentUid = StringUtility::getUniqueId('NEW');
             }
+            if (strpos($currentUid, 'NEW') === 0) {
+                $recordData['pid'] = $pageId;
+            }
             unset($recordData['uid']);
             $dataMap[$tableName][$currentUid] = $recordData;
             if ($previousTableName !== null && $previousUid !== null) {