Skip to content

Commit 86f18aa

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 d2733f3 commit 86f18aa

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
@@ -79,15 +79,14 @@ public static function import(string $path): void
7979
// types correctly (like Connection::PARAM_LOB) allows doctrine to create valid SQL
8080
$types = [];
8181
foreach ($element as $columnName => $columnValue) {
82-
$columnType = $tableDetails->getColumn($columnName)->getType();
82+
$types[$columnName] = $columnType = $tableDetails->getColumn($columnName)->getType();
8383
// JSON-Field data is converted (json-encode'd) within $connection->insert(), and since json field
8484
// data can only be provided json encoded in the csv dataset files, we need to decode them here.
8585
if ($element[$columnName] !== null
8686
&& $columnType instanceof JsonType
8787
) {
8888
$element[$columnName] = $columnType->convertToPHPValue($columnValue, $platform);
8989
}
90-
$types[] = $columnType->getBindingType();
9190
}
9291
// Insert the row
9392
$connection->insert($tableName, $element, $types);

0 commit comments

Comments
 (0)