8000 Form config + tests + changelog · symfony/symfony@47b92d4 · GitHub
[go: up one dir, main page]

Skip to content

Commit 47b92d4

Browse files
committed
Form config + tests + changelog
1 parent 97249de commit 47b92d4

File tree

6 files changed

+13
-5
lines changed

6 files changed

+13
-5
lines changed

src/Symfony/Bundle/FrameworkBundle/Resources/config/form.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,11 @@
125125
->args([service('request_stack')])
126126

127127
->set('form.type_extension.form.validator', FormTypeValidatorExtension::class)
128-
->args([service('validator')])
128+
->args([
129+
service('validator'),
130+
service('twig.form.renderer')->ignoreOnInvalid(),
131+
service('translator')->ignoreOnInvalid(),
132+
])
129133
->tag('form.type_extension', ['extended-type' => FormType::class])
130134

131135
->set('form.type_extension.repeated.validator', RepeatedTypeValidatorExtension::class)

src/Symfony/Component/Form/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
CHANGELOG
22
=========
33

4+
5.2.0
5+
-----
6+
* Added support for using the `{{ label }}` placeholder in constraint messages, which is replaced in the `ViolationMapper` by the corresponding field form label.
7+
48
5.1.0
59
-----
610

src/Symfony/Component/Form/Test/Traits/ValidatorExtensionTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,6 @@ protected function getValidatorExtension(): ValidatorExtension
3939
$this->validator->expects($this->any())->method('getMetadataFor')->will($this->returnValue($metadata));
4040
$this->validator->expects($this->any())->method('validate')->will($this->returnValue(new ConstraintViolationList()));
4141

42-
return new ValidatorExtension($this->validator, false);
42+
return new ValidatorExtension($this->validator, null, null, false);
4343
}
4444
}

src/Symfony/Component/Form/Tests/Extension/Validator/Constraints/FormValidatorPerformanceTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class FormValidatorPerformanceTest extends FormPerformanceTestCase
2323
protected function getExtensions()
2424
{
2525
return [
26-
new ValidatorExtension(Validation::createValidator(), false),
26+
new ValidatorExtension(Validation::createValidator(), null, null, false),
2727
];
2828
}
2929

src/Symfony/Component/Form/Tests/Extension/Validator/Type/FormTypeValidatorExtensionTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public function testValidConstraint()
6464
public function testGroupSequenceWithConstraintsOption()
6565
{
6666
$form = Forms::createFormFactoryBuilder()
67-
->addExtension(new ValidatorExtension(Validation::createValidator(), false))
67+
->addExtension(new ValidatorExtension(Validation::createValidator(), null, null, false))
6868
->getFormFactory()
6969
->create(FormTypeTest::TESTED_TYPE, null, (['validation_groups' => new GroupSequence(['First', 'Second'])]))
7070
->add('field', TextTypeTest::TESTED_TYPE, [

src/Symfony/Component/Form/Tests/Extension/Validator/ValidatorExtensionTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function test2Dot5ValidationApi()
3535
->setMetadataFactory($metadataFactory)
3636
->getValidator();
3737

38-
$extension = new ValidatorExtension($validator, false);
38+
$extension = new ValidatorExtension($validator, null, null, false);
3939

4040
$this->assertInstanceOf(ValidatorTypeGuesser::class, $extension->loadTypeGuesser());
4141

0 commit comments

Comments
 (0)
0