From 787e399aed14986b1ff6641137bf1fecbe49af74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20B=C3=BCrk?= Date: Mon, 10 Nov 2025 18:21:10 +0100 Subject: [PATCH] [BUGFIX] Use the doctrine type instead of binding type in `DataSet` This change uses the doctrine type instead of the type bindingtype in `DataSet->import()` still ensuring that the value is encoded with current implementation within the TYPO3 Connection, while preparing to remove custom handling and using Doctrine DBAL behavour. With this modification both code paths are working. Additionally, the columnname is now used for the created types array effectly fixing a bug that this information has not been used and fallback to database schema was used anyway. Releases: main, 9, 8 --- Classes/Core/Functional/Framework/DataHandling/DataSet.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Classes/Core/Functional/Framework/DataHandling/DataSet.php b/Classes/Core/Functional/Framework/DataHandling/DataSet.php index fbcffd77..02273a20 100644 --- a/Classes/Core/Functional/Framework/DataHandling/DataSet.php +++ b/Classes/Core/Functional/Framework/DataHandling/DataSet.php @@ -76,13 +76,12 @@ public static function import(string $path): void // types correctly (like Connection::PARAM_LOB) allows doctrine to create valid SQL $types = []; foreach ($element as $columnName => $columnValue) { - $columnType = $tableDetails->getColumn($columnName)->getType(); + $types[$columnName] = $columnType = $tableDetails->getColumn($columnName)->getType(); // JSON-Field data is converted (json-encode'd) within $connection->insert(), and since json field // data can only be provided json encoded in the csv dataset files, we need to decode them here. if ($columnValue !== null && $columnType instanceof JsonType) { $element[$columnName] = $columnType->convertToPHPValue($columnValue, $platform); } - $types[] = $columnType->getBindingType(); } // Insert the row $connection->insert($tableName, $element, $types);