Skip to content

Commit a640103

Browse files
Merge branch '2.8' into 3.4
* 2.8: update test for Twig performance optimizations [WebProfilerBundle] Increase retry delays between toolbarAction ajax calls support sapi_windows_vt100_support for php 7.2+ bumped Symfony version to 2.8.35 updated VERSION for 2.8.34 updated CHANGELOG for 2.8.34 bumped Symfony version to 2.7.42 updated VERSION for 2.7.41 update CONTRIBUTORS for 2.7.41 updated CHANGELOG for 2.7.41 [HttpFoundation] Added "null" type on Request::create docblock Allow trans filter to be safe
2 parents a69e3f2 + 77ce1a7 commit a640103

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

Resources/views/Form/form_div_layout.html.twig

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,13 @@
271271
{% set label = name|humanize %}
272272
{%- endif -%}
273273
{%- endif -%}
274-
<{{ element|default('label') }}{% if label_attr %}{% with { attr: label_attr } %}{{ block('attributes') }}{% endwith %}{% endif %}>{{ translation_domain is same as(false) ? label : label|trans({}, translation_domain) }}</{{ element|default('label') }}>
274+
<{{ element|default('label') }}{% if label_attr %}{% with { attr: label_attr } %}{{ block('attributes') }}{% endwith %}{% endif %}>
275+
{%- if translation_domain is same as(false) -%}
276+
{{- label -}}
277+
{%- else -%}
278+
{{- label|trans({}, translation_domain) -}}
279+
{%- endif -%}
280+
</{{ element|default('label') }}>
275281
{%- endif -%}
276282
{%- endblock form_label -%}
277283

Tests/Node/TransNodeTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ protected function getVariableGetterWithoutStrictCheck($name)
5353

5454
protected function getVariableGetterWithStrictCheck($name)
5555
{
56+
if (Environment::VERSION_ID > 20404) {
57+
return sprintf('(isset($context["%s"]) || array_key_exists("%1$s", $context) ? $context["%1$s"] : (function () { throw new Twig_Error_Runtime(\'Variable "%1$s" does not exist.\', 0, $this->source); })())', $name);
58+
}
59+
5660
if (Environment::MAJOR_VERSION >= 2) {
5761
return sprintf('(isset($context["%s"]) || array_key_exists("%1$s", $context) ? $context["%1$s"] : (function () { throw new Twig_Error_Runtime(\'Variable "%1$s" does not exist.\', 0, $this->getSourceContext()); })())', $name);
5862
}

0 commit comments

Comments
 (0)