Skip to content

Commit 8374c8e

Browse files
committed
[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
1 parent c20a052 commit 8374c8e

File tree

1 file changed

+1
-2
lines changed
  • Classes/Core/Functional/Framework/DataHandling

1 file changed

+1
-2
lines changed

Classes/Core/Functional/Framework/DataHandling/DataSet.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,12 @@ public static function import(string $path): void
7676
// types correctly (like Connection::PARAM_LOB) allows doctrine to create valid SQL
7777
$types = [];
7878
foreach ($element as $columnName => $columnValue) {
79-
$columnType = $tableDetails->getColumn($columnName)->getType();
79+
$types[$columnName] = $columnType = $tableDetails->getColumn($columnName)->getType();
8080
// JSON-Field data is converted (json-encode'd) within $connection->insert(), and since json field
8181
// data can only be provided json encoded in the csv dataset files, we need to decode them here.
8282
if ($columnValue !== null && $columnType instanceof JsonType) {
8383
$element[$columnName] = $columnType->convertToPHPValue($columnValue, $platform);
8484
}
85-
$types[] = $columnType->getBindingType();
8685
}
8786
// Insert the row
8887
$connection->insert($tableName, $element, $types);

0 commit comments

Comments
 (0)