[BUGFIX] fetch_field_redirect returns object but not array 48/19448/2
authorChristian Kuhn <lolli@schwarzbu.ch>
Sat, 30 Mar 2013 13:51:28 +0000 (14:51 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Sat, 30 Mar 2013 14:16:54 +0000 (15:16 +0100)
Method sql_field_type was rewritten with the mysqli switch for
compatibility with the old behavior. The introduced call to
fetch_field_redirect returns an object, but the result is
handled as an array, leading to warnings.

Change-Id: I73c434e8ce8086f4e60e119f4c2e2d1e2c9c7d20
Fixes: #46806
Related: #36419
Reviewed-on: https://review.typo3.org/19448
Reviewed-by: Philipp Gampe
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
Tested-by: Philipp Gampe
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
typo3/sysext/core/Classes/Database/DatabaseConnection.php

index a1d7f38..75d23c8 100644 (file)
@@ -1062,9 +1062,10 @@ class DatabaseConnection {
                );
                if ($this->debug_check_recordset($res)) {
                        $metaInfo = $res->fetch_field_direct($pointer);
-                       if ($metaInfo === FALSE)
+                       if ($metaInfo === FALSE) {
                                return FALSE;
-                       return $mysql_data_type_hash[$metaInfo['type']];
+                       }
+                       return $mysql_data_type_hash[$metaInfo->type];
                } else {
                        return FALSE;
                }