Fixed bug #11047: DBAL does not support CLOB/BLOB when using a mapped table name...
authorSteffen Kamper <info@sk-typo3.de>
Sun, 14 Jun 2009 20:26:07 +0000 (20:26 +0000)
committerSteffen Kamper <info@sk-typo3.de>
Sun, 14 Jun 2009 20:26:07 +0000 (20:26 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@5590 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/sysext/dbal/class.ux_t3lib_db.php

index 50a40eb..53af7aa 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,6 @@
 2009-06-14  Steffen Kamper  <info@sk-typo3.de>
 
+       * Fixed bug #11047: DBAL does not support CLOB/BLOB when using a mapped table name (thanks to Xavier Perseguers)
        * Fixed bug #11076: DBAL: Cannot connect to non-local Oracle database with SID (thanks to Xavier Perseguers)
        * Fixed bug #11327: Change 2 forgotten icons in t3skin (edit_fe and edit_file)
 
index cecc381..3c5ab8e 100644 (file)
@@ -1497,6 +1497,23 @@ class ux_t3lib_DB extends t3lib_DB {
         * @return      string          Returns the type of the specified field index
         */
        function sql_field_metatype($table,$field)      {
+                       // If $table and/or $field are mapped, use the original names instead
+               foreach ($this->mapping as $tableName => $tableMapInfo) {
+                       if (isset($tableMapInfo['mapTableName']) && $tableMapInfo['mapTableName'] === $table) {
+                                       // Table name is mapped => use original name
+                               $table = $tableName;
+                       }
+
+                       if (isset($tableMapInfo['mapFieldNames'])) {
+                               foreach ($tableMapInfo['mapFieldNames'] as $fieldName => $fieldMapInfo) {
+                                       if ($fieldMapInfo === $field) {
+                                                       // Field name is mapped => use original name
+                                               $field = $fieldName;
+                                       }
+                               }
+                       }
+               }
+
                return $this->cache_fieldType[$table][$field]['metaType'];
        }