Skip to content

Commit b5ad792

Browse files
Merge branch '2.8' into 3.4
* 2.8: Fix CS Allow reuse of Session between requests Provide debug_backtrace with proper args forward false label option to nested types forward the invalid_message option in date types
2 parents dad1e12 + 70be548 commit b5ad792

File tree

3 files changed

+29
-0
lines changed

3 files changed

+29
-0
lines changed

Extension/Core/Type/DateTimeType.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,11 @@ public function buildForm(FormBuilderInterface $builder, array $options)
119119
'invalid_message_parameters',
120120
)));
121121

122+
if (false === $options['label']) {
123+
$dateOptions['label'] = false;
124+
$timeOptions['label'] = false;
125+
}
126+
122127
if (null !== $options['date_widget']) {
123128
$dateOptions['widget'] = $options['date_widget'];
124129
}

Extension/Core/Type/DateType.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,18 @@ public function buildForm(FormBuilderInterface $builder, array $options)
7777
'error_bubbling' => true,
7878
);
7979

80+
if (isset($options['invalid_message'])) {
81+
$dayOptions['invalid_message'] = $options['invalid_message'];
82+
$monthOptions['invalid_message'] = $options['invalid_message'];
83+
$yearOptions['invalid_message'] = $options['invalid_message'];
84+
}
85+
86+
if (isset($options['invalid_message_parameters'])) {
87+
$dayOptions['invalid_message_parameters'] = $options['invalid_message_parameters'];
88+
$monthOptions['invalid_message_parameters'] = $options['invalid_message_parameters'];
89+
$yearOptions['invalid_message_parameters'] = $options['invalid_message_parameters'];
90+
}
91+
8092
$formatter = new \IntlDateFormatter(
8193
\Locale::getDefault(),
8294
$dateFormat,

Extension/Core/Type/TimeType.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,18 @@ public function buildForm(FormBuilderInterface $builder, array $options)
7272
'error_bubbling' => true,
7373
);
7474

75+
if (isset($options['invalid_message'])) {
76+
$hourOptions['invalid_message'] = $options['invalid_message'];
77+
$minuteOptions['invalid_message'] = $options['invalid_message'];
78+
$secondOptions['invalid_message'] = $options['invalid_message'];
79+
}
80+
81+
if (isset($options['invalid_message_parameters'])) {
82+
$hourOptions['invalid_message_parameters'] = $options['invalid_message_parameters'];
83+
$minuteOptions['invalid_message_parameters'] = $options['invalid_message_parameters'];
84+
$secondOptions['invalid_message_parameters'] = $options['invalid_message_parameters'];
85+
}
86+
7587
if ('choice' === $options['widget']) {
7688
$hours = $minutes = array();
7789

0 commit comments

Comments
 (0)