Follow-up 2 to #11764: fixed bug that occured when localizing records via tceforms
authorRupert Germann <rupi@gmx.li>
Tue, 25 Aug 2009 20:11:39 +0000 (20:11 +0000)
committerRupert Germann <rupi@gmx.li>
Tue, 25 Aug 2009 20:11:39 +0000 (20:11 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@5824 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/class.t3lib_transl8tools.php
typo3/class.db_list_extra.inc

index 08839b0..65c699f 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2009-08-24  Rupert Germann  <rupi@gmx.li>
+
+       * Follow-up 2 to #11764: fixed bug that occured when localizing records via tceforms
+
 2009-08-25  Oliver Hader  <oliver@typo3.org>
 
        * Added feature #11707: Integrate possibility to enable/disable the deprecation logging (thanks to Sascha Kettler)
index 35a7440..8ed06fb 100644 (file)
@@ -130,9 +130,10 @@ class t3lib_transl8tools   {
         * @param       integer         Record uid
         * @param       integer         Language uid. If zero, then all languages are selected.
         * @param       array           The record to be translated
+        * @param       array           select fields for the query which fetches the translations of the current record
         * @return      array           Array with information. Errors will return string with message.
         */
-       function translationInfo($table, $uid, $sys_language_uid = 0, $row = NULL) {
+       function translationInfo($table, $uid, $sys_language_uid = 0, $row = NULL, $selFieldList = '') {
                global $TCA;
 
                if ($TCA[$table] && $uid)       {
@@ -150,7 +151,7 @@ class t3lib_transl8tools    {
 
                                                                // Look for translations of this record, index by language field value:
                                                        $translationsTemp = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
-                                                               $this->selFieldList,
+                                                               ($selFieldList ? $selFieldList : 'uid,'.$TCA[$trTable]['ctrl']['languageField']),
                                                                $trTable,
                                                                $TCA[$trTable]['ctrl']['transOrigPointerField'] . '=' . intval($uid) .
                                                                        ' AND pid=' . intval($table === 'pages' ? $row['uid'] : $row['pid']).   // Making exception for pages of course where the translations will always be ON the page, not on the level above...
index b911136..f626396 100644 (file)
@@ -121,6 +121,7 @@ class localRecordList extends recordList {
 
        var $references;                                                // References of the current record
        var $translations;                                              // Translations of the current record
+       var $selFieldList;                                              // select fields for the query which fetches the translations of the current record
 
        public function __construct() {
                parent::__construct();
@@ -377,7 +378,7 @@ class localRecordList extends recordList {
                $selectFields = array_unique($selectFields);            // Unique list!
                $selectFields = array_intersect($selectFields,$this->makeFieldList($table,1));          // Making sure that the fields in the field-list ARE in the field-list from TCA!
                $selFieldList = implode(',',$selectFields);             // implode it into a list of fields for the SQL-statement.
-               $this->translateTools->selFieldList = $selFieldList;
+               $this->selFieldList = $selFieldList;
 
                /**
                 * @hook                        DB-List getTable
@@ -1429,7 +1430,7 @@ class localRecordList extends recordList {
                        1 => '',
                );
 
-               $translations = $this->translateTools->translationInfo($table, $row['uid'], 0, $row);
+               $translations = $this->translateTools->translationInfo($table, $row['uid'], 0, $row, $this->selFieldList);
                $this->translations = $translations['translations'];
 
                        // Language title and icon: