8000 bug #9453 [Form][DateTime] Propagate invalid_message & invalid_messag… · symfony/symfony@1653ca5 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1653ca5

Browse files
committed
bug #9453 [Form][DateTime] Propagate invalid_message & invalid_message_parameters to date & time (egeloen)
This PR was submitted for the master branch but it was merged into the 2.3 branch instead (closes #9453). Discussion ---------- [Form][DateTime] Propagate invalid_message & invalid_message_parameters to date & time | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - This PR propagates the `invalid_message` & `invalid_message_parameters` in the datetime form type to the date & time sub form types. It allows to have the good error message if you use something else than the `single_widget` widget. I have looked the `DateTimeTypeTest` but I have not found tests related to this kind of propagation, so for now I have not added tests yet. Commits ------- ea4ae74 [Form][DateTime] Propagate invalid_message & invalid_message parameters to date & time sub widgets
2 parents 87123f6 + ea4ae74 commit 1653ca5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Symfony/Component/Form/Extension/Core/Type/DateTimeType.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,8 @@ public function buildForm(FormBuilderInterface $builder, array $options)
117117
'empty_value',
118118
'required',
119119
'translation_domain',
120+
'invalid_message',
121+
'invalid_message_parameters',
120122
)));
121123

122124
$timeOptions = array_intersect_key($options, array_flip(array(
@@ -128,6 +130,8 @@ public function buildForm(FormBuilderInterface $builder, array $options)
128130
'empty_value',
129131
'required',
130132
'translation_domain',
133+
'invalid_message',
134+
'invalid_message_parameters',
131135
)));
132136

133137
if (null !== $options['date_widget']) {

0 commit comments

Comments
 (0)
0