Skip to content

Commit df8cfd0

Browse files
committed
Merge branch '6.4' into 7.0
* 6.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 [Mailer] [Brevo] Check that tags is present in payload before calling setTags [Serializer] Fix object normalizer when properties has the same name as their accessor
2 parents e3cf349 + e72ac77 commit df8cfd0

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
@@ -29,7 +29,7 @@
2929
"symfony/dependency-injection": "^6.4|^7.0",
3030
"symfony/doctrine-messenger": "^6.4|^7.0",
3131
"symfony/expression-language": "^6.4|^7.0",
32-
"symfony/form": "^6.4|^7.0",
32+
"symfony/form": "^6.4.6|^7.0",
3333
"symfony/http-kernel": "^6.4|^7.0",
3434
"symfony/lock": "^6.4|^7.0",
3535
"symfony/messenger": "^6.4|^7.0",
@@ -53,7 +53,7 @@
5353
"doctrine/orm": "<2.15",
5454
"symfony/cache": "<6.4",
5555
"symfony/dependency-injection": "<6.4",
56-
"symfony/form": "<6.4",
56+
"symfony/form": "<6.4.6",
5757
"symfony/http-foundation": "<6.4",
5858
"symfony/http-kernel": "<6.4",
5959
"symfony/lock": "<6.4",

0 commit comments

Comments
 (0)