Skip to content

Commit 77ce1a7

Browse files
Merge branch '2.7' into 2.8
* 2.7: 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.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 efdc8b3 + ab3d2bd commit 77ce1a7

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
@@ -224,7 +224,13 @@
224224
{% set label = name|humanize %}
225225
{%- endif -%}
226226
{%- endif -%}
227-
<label{% for attrname, attrvalue in label_attr %} {{ attrname }}="{{ attrvalue }}"{% endfor %}>{{ translation_domain is same as(false) ? label : label|trans({}, translation_domain) }}</label>
227+
<label{% for attrname, attrvalue in label_attr %} {{ attrname }}="{{ attrvalue }}"{% endfor %}>
228+
{%- if translation_domain is same as(false) -%}
229+
{{- label -}}
230+
{%- else -%}
231+
{{- label|trans({}, translation_domain) -}}
232+
{%- endif -%}
233+
</label>
228234
{%- endif -%}
229235
{%- endblock form_label -%}
230236

Tests/Node/TransNodeTest.php

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

5858
protected function getVariableGetterWithStrictCheck($name)
5959
{
60+
if (Environment::VERSION_ID > 20404) {
61+
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);
62+
}
63+
6064
if (Environment::MAJOR_VERSION >= 2) {
6165
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);
6266
}

0 commit comments

Comments
 (0)