Fixed bug #12719: Bugfix - tcemain copy/move/deleteL10nOverlayRecords is not fully...
authorSteffen Kamper <info@sk-typo3.de>
Tue, 24 Nov 2009 15:40:59 +0000 (15:40 +0000)
committerSteffen Kamper <info@sk-typo3.de>
Tue, 24 Nov 2009 15:40:59 +0000 (15:40 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@6512 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/class.t3lib_tcemain.php

index e3b6665..65c137f 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -12,6 +12,7 @@
 
 2009-11-24  Steffen Kamper  <info@sk-typo3.de>
 
 
 2009-11-24  Steffen Kamper  <info@sk-typo3.de>
 
+       * Fixed bug #12719: Bugfix - tcemain copy/move/deleteL10nOverlayRecords is not fully versioning-aware (thanks to Tolleiv Nietsch)
        * Fixed bug #12710: "Paste after" function destroys l10n-overlay relations (thanks to Tolleiv Nietsch)
        * Fixed bug #12700: pageInfo shows wrong info on root page
 
        * Fixed bug #12710: "Paste after" function destroys l10n-overlay relations (thanks to Tolleiv Nietsch)
        * Fixed bug #12700: pageInfo shows wrong info on root page
 
index 48dba56..b80e911 100644 (file)
@@ -3388,9 +3388,13 @@ class t3lib_TCEmain      {
                if (!t3lib_BEfunc::isTableLocalizable($table) || !empty($GLOBALS['TCA'][$table]['ctrl']['transForeignTable'])) {
                        return;
                }
                if (!t3lib_BEfunc::isTableLocalizable($table) || !empty($GLOBALS['TCA'][$table]['ctrl']['transForeignTable'])) {
                        return;
                }
-               t3lib_div::loadTCA($table);
 
 
-               $l10nRecords = t3lib_BEfunc::getRecordsByField($table, $GLOBALS['TCA'][$table]['ctrl']['transOrigPointerField'], $uid);
+               $where = '';
+               if (isset($GLOBALS['TCA'][$table]['ctrl']['versioningWS'])) {
+                       $where = ' AND t3ver_oid=0';
+               }
+
+               $l10nRecords = t3lib_BEfunc::getRecordsByField($table, $GLOBALS['TCA'][$table]['ctrl']['transOrigPointerField'], $uid, $where);
                if (is_array($l10nRecords)) {
                        foreach ($l10nRecords as $record) {
                                $this->copyRecord($table, $record['uid'], $destPid, $first, $overrideValues, $excludeFields, $record[$GLOBALS['TCA'][$table]['ctrl']['languageField']]);
                if (is_array($l10nRecords)) {
                        foreach ($l10nRecords as $record) {
                                $this->copyRecord($table, $record['uid'], $destPid, $first, $overrideValues, $excludeFields, $record[$GLOBALS['TCA'][$table]['ctrl']['languageField']]);
@@ -3805,9 +3809,12 @@ class t3lib_TCEmain      {
                if (!t3lib_BEfunc::isTableLocalizable($table) || !empty($GLOBALS['TCA'][$table]['ctrl']['transForeignTable'])) {
                        return;
                }
                if (!t3lib_BEfunc::isTableLocalizable($table) || !empty($GLOBALS['TCA'][$table]['ctrl']['transForeignTable'])) {
                        return;
                }
-               t3lib_div::loadTCA($table);
 
 
-               $l10nRecords = t3lib_BEfunc::getRecordsByField($table, $GLOBALS['TCA'][$table]['ctrl']['transOrigPointerField'], $uid);
+               $where = '';
+               if (isset($GLOBALS['TCA'][$table]['ctrl']['versioningWS'])) {
+                       $where = ' AND t3ver_oid=0';
+               }
+               $l10nRecords = t3lib_BEfunc::getRecordsByField($table, $GLOBALS['TCA'][$table]['ctrl']['transOrigPointerField'], $uid, $where);
                if (is_array($l10nRecords)) {
                        foreach ($l10nRecords as $record) {
                                $this->moveRecord($table, $record['uid'], $destPid);
                if (is_array($l10nRecords)) {
                        foreach ($l10nRecords as $record) {
                                $this->moveRecord($table, $record['uid'], $destPid);
@@ -4501,7 +4508,12 @@ class t3lib_TCEmain      {
                        return;
                }
 
                        return;
                }
 
-               $l10nRecords = t3lib_BEfunc::getRecordsByField($table, $GLOBALS['TCA'][$table]['ctrl']['transOrigPointerField'], $uid);
+               $where = '';
+               if (isset($GLOBALS['TCA'][$table]['ctrl']['versioningWS'])) {
+                       $where = ' AND t3ver_oid=0';
+               }
+
+               $l10nRecords = t3lib_BEfunc::getRecordsByField($table, $GLOBALS['TCA'][$table]['ctrl']['transOrigPointerField'], $uid, $where);
                if (is_array($l10nRecords)) {
                        foreach($l10nRecords as $record) {
                                $this->deleteAction($table, intval($record['t3ver_oid']) > 0 ? intval($record['t3ver_oid']) : intval($record['uid']));
                if (is_array($l10nRecords)) {
                        foreach($l10nRecords as $record) {
                                $this->deleteAction($table, intval($record['t3ver_oid']) > 0 ? intval($record['t3ver_oid']) : intval($record['uid']));