8000 Merge branch '2.6' into 2.7 · symfony/symfony@3ed00a8 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3ed00a8

Browse files
committed
Merge branch '2.6' into 2.7
* 2.6: [Form] fixed form tests when using 2.7 deps [TwigBridge] Fix bootstrap rendering when user explicitly use form_label Fixed HtmlDumper with long string Conflicts: src/Symfony/Component/Form/Tests/Extension/Validator/Constraints/FormValidatorTest.php
2 parents 9c6339e + b36900e commit 3ed00a8

File tree

3 files changed

+17
-13
lines changed

3 files changed

+17
-13
lines changed

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

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -156,19 +156,22 @@
156156
{%- endblock radio_label %}
157157

158158
{% block checkbox_radio_label %}
159-
{% if required %}
160-
{% set label_attr = label_attr|merge({class: (label_attr.class|default('') ~ ' required')|trim}) %}
161-
{% endif %}
162-
{% if parent_label_class is defined %}
163-
{% set label_attr = label_attr|merge({class: (label_attr.class|default('') ~ ' ' ~ parent_label_class)|trim}) %}
164-
{% endif %}
165-
{% if label is empty %}
166-
{% set label = name|humanize %}
159+
{# Do no display the label if widget is not defined in order to prevent double label rendering #}
160+
{% if widget is defined %}
161+
{% if required %}
162+
{% set label_attr = label_attr|merge({class: (label_attr.class|default('') ~ ' required')|trim}) %}
163+
{% endif %}
164+
{% if parent_label_class is defined %}
165+
{% set label_attr = label_attr|merge({class: (label_attr.class|default('') ~ ' ' ~ parent_label_class)|trim}) %}
166+
{% endif %}
167+
{% if label is empty %}
168+
{% set label = name|humanize %}
169+
{% endif %}
170+
<label{% for attrname, attrvalue in label_attr %} {{ attrname }}="{{ attrvalue }}"{% endfor %}>
171+
{{ widget|raw }}
172+
{{ label|trans({}, translation_domain) }}
173+
</label>
167174
{% endif %}
168-
<label{% for attrname, attrvalue in label_attr %} {{ attrname }}="{{ attrvalue }}"{% endfor %}>
169-
{{ widget|raw }}
170-
{{ label|trans({}, translation_domain) }}
171-
</label>
172175
{% endblock checkbox_radio_label %}
173176

174177
{# Rows #}

src/Symfony/Component/Form/Tests/Extension/Validator/Constraints/FormValidatorTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
use Symfony\Component\Form\Extension\Validator\Constraints\Form;
1919
use Symfony\Component\Form\Extension\Validator\Constraints\FormValidator;
2020
use Symfony\Component\Form\SubmitButtonBuilder;
21+
use Symfony\Component\Validator\Context\ExecutionContextInterface;
2122
use Symfony\Component\Validator\Constraints\NotNull;
2223
use Symfony\Component\Validator\Constraints\NotBlank;
2324
use Symfony\Component\Validator\Tests\Constraints\AbstractConstraintValidatorTest;

src/Symfony/Component/VarDumper/Dumper/HtmlDumper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class HtmlDumper extends CliDumper
3131
protected $headerIsDumped = false;
3232
protected $lastDepth = -1;
3333
protected $styles = array(
34-
'default' => 'background-color:#18171B; color:#FF8400; line-height:1.2em; font:12px Menlo, Monaco, Consolas, monospace',
34+
'default' => 'background-color:#18171B; color:#FF8400; line-height:1.2em; font:12px Menlo, Monaco, Consolas, monospace; word-wrap: break-word; white-space: pre-wrap',
3535
'num' => 'font-weight:bold; color:#1299DA',
3636
'const' => 'font-weight:bold',
3737
'str' => 'font-weight:bold; color:#56DB3A',

0 commit comments

Comments
 (0)
0