Skip to content

Commit ee63c20

Browse files
authored
fix: Casting issue due to MariaDB not included in inheritance schema anymore
1 parent c5798aa commit ee63c20

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ a release.
1818
---
1919

2020
## [Unreleased]
21+
### Fixed
22+
- Fix regression with `doctrine/dbal` >= 4.0 that caused MariaDB to improperly attempt LONGTEXT casting in `TranslationWalker` (issue #2887)
2123

2224
## [3.17.1] - 2024-10-07
2325
### Fixed

src/Translatable/Query/TreeWalker/TranslationWalker.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
namespace Gedmo\Translatable\Query\TreeWalker;
1111

1212
use Doctrine\DBAL\Connection;
13+
use Doctrine\DBAL\Platforms\AbstractMySQLPlatform;
1314
use Doctrine\DBAL\Platforms\AbstractPlatform;
14-
use Doctrine\DBAL\Platforms\MySQLPlatform;
1515
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
1616
use Doctrine\DBAL\Types\Type;
1717
use Doctrine\ORM\Mapping\ClassMetadata;
@@ -308,9 +308,9 @@ private function prepareTranslatedComponents(): void
308308

309309
// Treat translation as original field type
310310
$fieldMapping = $meta->getFieldMapping($field);
311-
if ((($this->platform instanceof MySQLPlatform)
311+
if ((($this->platform instanceof AbstractMySQLPlatform)
312312
&& in_array($fieldMapping['type'], ['decimal'], true))
313-
|| (!($this->platform instanceof MySQLPlatform)
313+
|| (!($this->platform instanceof AbstractMySQLPlatform)
314314
&& !in_array($fieldMapping['type'], ['datetime', 'datetimetz', 'date', 'time'], true))) {
315315
$type = Type::getType($fieldMapping['type']);
316316

0 commit comments

Comments
 (0)