Fixed bug #12781: The type in t3lib_TCEforms does not work if the type field shall...
authorOliver Hader <oliver.hader@typo3.org>
Sun, 29 Nov 2009 17:36:39 +0000 (17:36 +0000)
committerOliver Hader <oliver.hader@typo3.org>
Sun, 29 Nov 2009 17:36:39 +0000 (17:36 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@6590 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/class.t3lib_tceforms.php

index eb5cf23..649bd86 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -27,6 +27,7 @@
        * Fixed bug #12830: Wrong encoding of JSON data in t3lib_PageRenderer
        * Fixed bug #11395: TCAdefaults in Page TSConfig without effect on creating new element after existing one (thanks to Tolleiv Nietsch)
        * Fixed bug #12800: Add functionality to work with caching framework and DBAL (thanks to Xavier Perseguers)
+       * Fixed bug #12781: The type in t3lib_TCEforms does not work if the type field shall be excluded when translating (thanks to Fabrizio Branca)
 
 2009-11-26  Francois Suter  <francois@typo3.org>
 
index c8c908f..eafd938 100644 (file)
@@ -3047,7 +3047,13 @@ class t3lib_TCEforms     {
                        // If there is a "type" field configured...
                if ($TCA[$table]['ctrl']['type'])       {
                        $typeFieldName = $TCA[$table]['ctrl']['type'];
-                       $typeNum=$row[$typeFieldName];  // Get value of the row from the record which contains the type value.
+                       $typeFieldConfig = $TCA[$table]['columns'][$typeFieldName];
+                       if (isset($typeFieldConfig['l10n_mode']) && $typeFieldConfig['l10n_mode'] == 'exclude') {
+                                       // retrieve the typeNum from the original records's type field
+                               $typeNum = $this->defaultLanguageData[$table . ':' . $row['uid']][$typeFieldName];
+                       } else {
+                               $typeNum = $row[$typeFieldName];        // Get value of the row from the record which contains the type value.
+                       }
                        if (!strcmp($typeNum,''))       $typeNum=0;                     // If that value is an empty string, set it to "0" (zero)
                } else {
                        $typeNum = 0;   // If no "type" field, then set to "0" (zero)