Skip to content

Commit 979e10c

Browse files
Merge branch '6.4' into 7.0
* 6.4: (21 commits) [ErrorHandler] Add missing self-closing tags on link elements Fix merge (bis) Fix merge Add missing return type [FrameworkBundle] ConfigBuilderCacheWarmer should be non-optional [HttpClient] Fix pausing responses before they start when using curl [Notifier] Updated the NTFY notifier to run without a user parameter [Translation] Fix constant domain resolution in PhpAstExtractor separate child and parent context in NotificationEmail on writes [Mailer] [Mailgun] Fix sender header encoding do not overwrite the cache key when it is false [Mailer] [Scaleway] Fix attachment handling [Mailer] Throw TransportException when unable to read from socket [Serializer] Rewrite `AbstractObjectNormalizer::createChildContext()` to use the provided `cache_key` from original context when creating child contexts Revert #47715 [HttpClient] Fix error chunk creation in passthru Adjusting and removing the 'review' attribute from the pt_br translation XML. [DependencyInjection] Fix loading all env vars from secrets when only a subset is needed Fix option filenameMaxLength to the File constraint (Image) [Serializer] Take unnamed variadic parameters into account when denormalizing ...
2 parents c2fd6b0 + 6f21d07 commit 979e10c

File tree

56 files changed

+483
-90
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+483
-90
lines changed

src/Symfony/Bridge/Twig/Mime/NotificationEmail.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,26 @@ public function getHtmlTemplate(): ?string
174174
return '@email/'.$this->theme.'/notification/body.html.twig';
175175
}
176176

177+
/**
178+
* @return $this
179+
*/
180+
public function context(array $context): static
181+
{
182+
$parentContext = [];
183+
184+
foreach ($context as $key => $value) {
185+
if (\array_key_exists($key, $this->context)) {
186+
$this->context[$key] = $value;
187+
} else {
188+
$parentContext[$key] = $value;
189+
}
190+
}
191+
192+
parent::context($parentContext);
193+
194+
return $this;
195+
}
196+
177197
public function getContext(): array
178198
{
179199
return array_merge($this->context, parent::getContext());

src/Symfony/Bridge/Twig/Resources/views/Form/form_div_layout.html.twig

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
{# Attribute "required" is not supported #}
1515
{%- set required = false -%}
1616
{%- endif -%}
17-
<input type="{{ type }}" {{ block('widget_attributes') }}{% if value is not empty %} value="{{ value }}"{% endif %}>
17+
<input type="{{ type }}" {{ block('widget_attributes') }} {% if value is not empty %}value="{{ value }}" {% endif %}/>
1818
{%- endblock form_widget_simple -%}
1919

2020
{%- block form_widget_compound -%}
@@ -91,11 +91,11 @@
9191
{%- endblock choice_widget_options -%}
9292

9393
{%- block checkbox_widget -%}
94-
<input type="checkbox" {{ block('widget_attributes') }}{% if value is defined %} value="{{ value }}"{% endif %}{% if checked %} checked="checked"{% endif %}>
94+
<input type="checkbox" {{ block('widget_attributes') }}{% if value is defined %} value="{{ value }}"{% endif %}{% if checked %} checked="checked"{% endif %} />
9595
{%- endblock checkbox_widget -%}
9696

9797
{%- block radio_widget -%}
98-
<input type="radio" {{ block('widget_attributes') }}{% if value is defined %} value="{{ value }}"{% endif %}{% if checked %} checked="checked"{% endif %}>
98+
<input type="radio" {{ block('widget_attributes') }}{% if value is defined %} value="{{ value }}"{% endif %}{% if checked %} checked="checked"{% endif %} />
9999
{%- endblock radio_widget -%}
100100

101101
{%- block datetime_widget -%}
@@ -402,7 +402,7 @@
402402
{%- endif -%}
403403
<form{% if name != '' %} name="{{ name }}"{% endif %} method="{{ form_method|lower }}"{% if action != '' %} action="{{ action }}"{% endif %}{{ block('attributes') }}{% if multipart %} enctype="multipart/form-data"{% endif %}>
404404
{%- if form_method != method -%}
405-
<input type="hidden" name="_method" value="{{ method }}">
405+
<input type="hidden" name="_method" value="{{ method }}" />
406406
{%- endif -%}
407407
{%- endblock form_start -%}
408408

@@ -440,7 +440,7 @@
440440
{%- endif -%}
441441

442442
{%- if form_method != method -%}
443-
<input type="hidden" name="_method" value="{{ method }}">
443+
<input type="hidden" name="_method" value="{{ method }}" />
444444
{%- endif -%}
445445
{% endif -%}
446446
{% endblock form_rest %}

src/Symfony/Bridge/Twig/Test/FormLayoutTestCase.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@ protected function assertMatchesXpath($html, $expression, $count = 1): void
5252
{
5353
$dom = new \DOMDocument('UTF-8');
5454

55-
$html = preg_replace('/(<input [^>]+)(?<!\/)>/', '$1/>', $html);
56-
5755
try {
5856
// Wrap in <root> node so we can load HTML with multiple tags at
5957
// the top level

src/Symfony/Bridge/Twig/Tests/Extension/AbstractBootstrap3LayoutTestCase.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2797,7 +2797,7 @@ public function testWidgetAttributes()
27972797
$html = $this->renderWidget($form->createView());
27982798

27992799
// compare plain HTML to check the whitespace
2800-
$this->assertSame('<input type="text" id="text" name="text" disabled="disabled" required="required" readonly="readonly" maxlength="10" pattern="\d+" class="foobar form-control" data-foo="bar" value="value">', $html);
2800+
$this->assertSame('<input type="text" id="text" name="text" disabled="disabled" required="required" readonly="readonly" maxlength="10" pattern="\d+" class="foobar form-control" data-foo="bar" value="value" />', $html);
28012801
}
28022802

28032803
public function testWidgetAttributeNameRepeatedIfTrue()
@@ -2809,7 +2809,7 @@ public function testWidgetAttributeNameRepeatedIfTrue()
28092809
$html = $this->renderWidget($form->createView());
28102810

28112811
// foo="foo"
2812-
$this->assertSame('<input type="text" id="text" name="text" required="required" foo="foo" class="form-control" value="value">', $html);
2812+
$this->assertSame('<input type="text" id="text" name="text" required="required" foo="foo" class="form-control" value="value" />', $html);
28132813
}
28142814

28152815
public function testButtonAttributes()

src/Symfony/Bridge/Twig/Tests/Extension/AbstractLayoutTestCase.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2448,7 +2448,7 @@ public function testWidgetAttributes()
24482448
$html = $this->renderWidget($form->createView());
24492449

24502450
// compare plain HTML to check the whitespace
2451-
$this->assertSame('<input type="text" id="text" name="text" disabled="disabled" required="required" readonly="readonly" maxlength="10" pattern="\d+" class="foobar" data-foo="bar" value="value">', $html);
2451+
$this->assertSame('<input type="text" id="text" name="text" disabled="disabled" required="required" readonly="readonly" maxlength="10" pattern="\d+" class="foobar" data-foo="bar" value="value" />', $html);
24522452
}
24532453

24542454
public function testWidgetAttributeNameRepeatedIfTrue()