Skip to content

Commit e72ac77

Browse files
committed
Merge branch '5.4' into 6.4
* 5.4: fix tests Drop test case Catch TableNotFoundException in MySQL delete [DoctrineBridge] Fix deprecation warning with ORM 3 when guessing field lengths Throw TransformationFailedException when there is a null bytes injection [Cache][Lock] Identify missing table in pgsql correctly and address failing integration tests [Serializer] Fix object normalizer when properties has the same name as their accessor
2 parents fb868f2 + a748704 commit e72ac77

File tree

3 files changed

+7
-17
lines changed

3 files changed

+7
-17
lines changed

Form/DoctrineOrmTypeGuesser.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use Doctrine\DBAL\Types\Types;
1515
use Doctrine\ORM\Mapping\ClassMetadata;
1616
use Doctrine\ORM\Mapping\ClassMetadataInfo;
17+
use Doctrine\ORM\Mapping\FieldMapping;
1718
use Doctrine\ORM\Mapping\JoinColumnMapping;
1819
use Doctrine\ORM\Mapping\MappingException as LegacyMappingException;
1920
use Doctrine\Persistence\ManagerRegistry;
@@ -129,8 +130,10 @@ public function guessMaxLength(string $class, string $property): ?ValueGuess
129130
if ($ret && isset($ret[0]->fieldMappings[$property]) && !$ret[0]->hasAssociation($property)) {
130131
$mapping = $ret[0]->getFieldMapping($property);
131132

132-
if (isset($mapping['length'])) {
133-
return new ValueGuess($mapping['length'], Guess::HIGH_CONFIDENCE);
133+
$length = $mapping instanceof FieldMapping ? $mapping->length : ($mapping['length'] ?? null);
134+
135+
if (null !== $length) {
136+
return new ValueGuess($length, Guess::HIGH_CONFIDENCE);
134137
}
135138

136139
if (\in_array($ret[0]->getTypeOfField($property), [Types::DECIMAL, Types::FLOAT])) {

Tests/Form/Type/EntityTypeTest.php

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1314,19 +1314,6 @@ public function testPassIdAndNameToView()
13141314
$this->assertEquals('name', $view->vars['full_name']);
13151315
}
13161316

1317-
public function testStripLeadingUnderscoresAndDigitsFromId()
1318-
{
1319-
$view = $this->factory->createNamed('_09name', static::TESTED_TYPE, null, [
1320-
'em' => 'default',
1321-
'class' => self::SINGLE_IDENT_CLASS,
1322-
])
1323-
->createView();
1324-
1325-
$this->assertEquals('name', $view->vars['id']);
1326-
$this->assertEquals('_09name', $view->vars['name']);
1327-
$this->assertEquals('_09name', $view->vars['full_name']);
1328-
}
1329-
13301317
public function testPassIdAndNameToViewWithParent()
13311318
{
13321319
$view = $this->factory->createNamedBuilder('parent', FormTypeTest::TESTED_TYPE)

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"symfony/dependency-injection": "^6.2|^7.0",
3131
"symfony/doctrine-messenger": "^5.4|^6.0|^7.0",
3232
"symfony/expression-language": "^5.4|^6.0|^7.0",
33-
"symfony/form": "^5.4.21|^6.2.7|^7.0",
33+
"symfony/form": "^5.4.38|^6.4.6|^7.0",
3434
"symfony/http-kernel": "^6.3|^7.0",
3535
"symfony/lock": "^6.3|^7.0",
3636
"symfony/messenger": "^5.4|^6.0|^7.0",
@@ -55,7 +55,7 @@
5555
"doctrine/orm": "<2.15",
5656
"symfony/cache": "<5.4",
5757
"symfony/dependency-injection": "<6.2",
58-
"symfony/form": "<5.4.21|>=6,<6.2.7",
58+
"symfony/form": "<5.4.38|>=6,<6.4.6",
5959
"symfony/http-foundation": "<6.3",
6060
"symfony/http-kernel": "<6.2",
6161
"symfony/lock": "<6.3",

0 commit comments

Comments
 (0)