Skip to content

Commit 4815454

Browse files
Merge branch '5.4' into 6.0
* 5.4: (21 commits) Add missing license header [Workflow] Catch error when trying to get an uninitialized marking Add missing license header Allow usage of Provider domains if possible Use reference date in reverse transform Fixes #40997 Fix env resolution in lock configuration Fix Symfony not working on SMB share #45990 [Messenger] DoctrineTransportFactory works with notify and decorated PostgreSQL driver [Cache] make LockRegistry use static properties instead of static variables fix: return-path has higher priority for envelope address than from address (fixes #41322) [HttpClient] Fix sending content-length when streaming the body [Console] Header with column max width is now well wrap with separator Fix use_cookies framework session configuration [FrameworkBundle] [Command] Fix `debug:router --no-interaction` error … [Intl] Update the ICU data to 71.1 - 5.4 [Intl] Update the ICU data to 71.1 - 4.4 Add tests to messenger connection get for OraclePlatform [RateLimiter] Adding default empty value [DependencyInjection] Add TaggedIteratorArgument unit tests [Process] Fix Process::getEnv() when setEnv() hasn't been called before ...
2 parents 0cd9d84 + 000f3e1 commit 4815454

File tree

4 files changed

+32
-2
lines changed

4 files changed

+32
-2
lines changed

Extension/Core/Type/TimeType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ public function buildForm(FormBuilderInterface $builder, array $options)
205205
));
206206
} elseif ('array' === $options['input']) {
207207
$builder->addModelTransformer(new ReversedTransformer(
208-
new DateTimeToArrayTransformer($options['model_timezone'], $options['model_timezone'], $parts)
208+
new DateTimeToArrayTransformer($options['model_timezone'], $options['model_timezone'], $parts, 'text' === $options['widget'], $options['reference_date'])
209209
));
210210
}
211211
}

Tests/ChoiceList/Loader/FilterChoiceLoaderDecoratorTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<?php
22

3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
312
namespace Symfony\Component\Form\Tests\ChoiceList\Loader;
413

514
use PHPUnit\Framework\TestCase;

Tests/Extension/Core/DataTransformer/StringToFloatTransformerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/*
4-
* This file is part of the symfony/symfony package.
4+
* This file is part of the Symfony package.
55
*
66
* (c) Fabien Potencier <[email protected]>
77
*

Tests/Extension/Core/Type/TimeTypeTest.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1000,6 +1000,27 @@ public function testArrayTimeWithReferenceDoesNotUseReferenceTimeOnZero()
10001000
$this->assertSame($input, $form->getViewData());
10011001
}
10021002

1003+
public function testArrayTimeWithReferenceDoesUseReferenceDateOnModelTransform()
1004+
{
1005+
$input = [
1006+
'hour' => '21',
1007+
'minute' => '45',
1008+
];
1009+
1010+
$form = $this->factory->create(static::TESTED_TYPE, $input, [
1011+
'model_timezone' => 'UTC',
1012+
'view_timezone' => 'Europe/Berlin',
1013+
'reference_date' => new \DateTimeImmutable('01-05-2021 12:34:56', new \DateTimeZone('UTC')),
1014+
'input' => 'array',
1015+
]);
1016+
1017+
$this->assertSame($input, $form->getData());
1018+
$this->assertEquals([
1019+
'hour' => '23',
1020+
'minute' => '45',
1021+
], $form->getViewData());
1022+
}
1023+
10031024
/**
10041025
* @dataProvider provideEmptyData
10051026
*/

0 commit comments

Comments
 (0)