[TASK] Add details to message for existing record localization 86/57586/5
authorMathias Brodala <mbrodala@pagemachine.de>
Fri, 13 Jul 2018 13:30:38 +0000 (15:30 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Mon, 3 Sep 2018 15:44:15 +0000 (17:44 +0200)
Resolves: #85549
Releases: master
Change-Id: I8a98da8842c6d15175debed5513bbc4bc2bb0a2c
Reviewed-on: https://review.typo3.org/57586
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/core/Classes/DataHandling/DataHandler.php

index b344306..b8810b3 100644 (file)
@@ -4853,10 +4853,16 @@ class DataHandler implements LoggerAwareInterface
             return false;
         }
 
-        $pass = !BackendUtility::getRecordLocalization($table, $uid, $language, 'AND pid=' . (int)$row['pid']);
+        $recordLocalizations = BackendUtility::getRecordLocalization($table, $uid, $language, 'AND pid=' . (int)$row['pid']);
 
-        if (!$pass) {
-            $this->newlog('Localization failed; There already was a localization for this language of the record ' . $table . ':' . $uid . '!', 1);
+        if (!empty($recordLocalizations)) {
+            $this->newlog(sprintf(
+                'Localization failed: there already are localizations (%s) for language %d of the "%s" record %d!',
+                implode(', ', array_column($recordLocalizations, 'uid')),
+                $language,
+                $table,
+                $uid
+            ), 1);
             return false;
         }