From 0a327eb639226f5461d52af10b6d75a70d8d3cdd Mon Sep 17 00:00:00 2001 From: Hippolyte Alain Date: Wed, 21 Jan 2015 18:40:20 +0100 Subject: [PATCH 1/3] Fixed HtmlDumper with long string --- src/Symfony/Component/VarDumper/Dumper/HtmlDumper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Component/VarDumper/Dumper/HtmlDumper.php b/src/Symfony/Component/VarDumper/Dumper/HtmlDumper.php index b587e78f91..4ff6f82f2c 100644 --- a/src/Symfony/Component/VarDumper/Dumper/HtmlDumper.php +++ b/src/Symfony/Component/VarDumper/Dumper/HtmlDumper.php @@ -31,7 +31,7 @@ class HtmlDumper extends CliDumper protected $headerIsDumped = false; protected $lastDepth = -1; protected $styles = array( - 'default' => 'background-color:#18171B; color:#FF8400; line-height:1.2em; font:12px Menlo, Monaco, Consolas, monospace', + 'default' => 'background-color:#18171B; color:#FF8400; line-height:1.2em; font:12px Menlo, Monaco, Consolas, monospace; word-wrap: break-word; white-space: pre-wrap', 'num' => 'font-weight:bold; color:#1299DA', 'const' => 'font-weight:bold', 'str' => 'font-weight:bold; color:#56DB3A', From 717c6d1800b608c8bb7f3cd5b6efeb9f5b9726bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Pineau?= Date: Fri, 23 Jan 2015 12:14:04 +0100 Subject: [PATCH 2/3] [TwigBridge] Fix bootstrap rendering when user explicitly use form_label --- .../views/Form/bootstrap_3_layout.html.twig | 27 ++++++++++--------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_3_layout.html.twig b/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_3_layout.html.twig index e934305014..f82979cd62 100644 --- a/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_3_layout.html.twig +++ b/src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_3_layout.html.twig @@ -156,19 +156,22 @@ {%- endblock radio_label %} {% block checkbox_radio_label %} - {% if required %} - {% set label_attr = label_attr|merge({class: (label_attr.class|default('') ~ ' required')|trim}) %} + {# Do no display the label if widget is not defined in order to prevent double label rendering #} + {% if widget is defined %} + {% if required %} + {% set label_attr = label_attr|merge({class: (label_attr.class|default('') ~ ' required')|trim}) %} + {% endif %} + {% if parent_label_class is defined %} + {% set label_attr = label_attr|merge({class: (label_attr.class|default('') ~ ' ' ~ parent_label_class)|trim}) %} + {% endif %} + {% if label is empty %} + {% set label = name|humanize %} + {% endif %} + + {{ widget|raw }} + {{ label|trans({}, translation_domain) }} + {% endif %} - {% if parent_label_class is defined %} - {% set label_attr = label_attr|merge({class: (label_attr.class|default('') ~ ' ' ~ parent_label_class)|trim}) %} - {% endif %} - {% if label is empty %} - {% set label = name|humanize %} - {% endif %} - - {{ widget|raw }} - {{ label|trans({}, translation_domain) }} - {% endblock checkbox_radio_label %} {# Rows #} From a55f5c8dda93616e44ccc9a98b27e8d3319b37d3 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Sun, 25 Jan 2015 04:21:54 +0100 Subject: [PATCH 3/3] [Form] fixed form tests when using 2.7 deps --- .../Validator/Constraints/FormValidatorTest.php | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/Symfony/Component/Form/Tests/Extension/Validator/Constraints/FormValidatorTest.php b/src/Symfony/Component/Form/Tests/Extension/Validator/Constraints/FormValidatorTest.php index e1b941ab8e..3dd8a83a33 100644 --- a/src/Symfony/Component/Form/Tests/Extension/Validator/Constraints/FormValidatorTest.php +++ b/src/Symfony/Component/Form/Tests/Extension/Validator/Constraints/FormValidatorTest.php @@ -18,6 +18,7 @@ use Symfony\Component\Form\FormInterface; use Symfony\Component\Form\Extension\Validator\Constraints\Form; use Symfony\Component\Form\Extension\Validator\Constraints\FormValidator; use Symfony\Component\Form\SubmitButtonBuilder; +use Symfony\Component\Validator\Context\ExecutionContextInterface; use Symfony\Component\Validator\Constraints\NotNull; use Symfony\Component\Validator\Constraints\NotBlank; use Symfony\Component\Validator\Tests\Constraints\AbstractConstraintValidatorTest; @@ -224,14 +225,12 @@ class FormValidatorTest extends AbstractConstraintValidatorTest $this->validator->validate($form, new Form()); - $is2Dot4Api = Validation::API_VERSION_2_4 === $this->getApiVersion(); - $this->buildViolation('invalid_message_key') ->setParameter('{{ value }}', 'foo') ->setParameter('{{ foo }}', 'bar') ->setInvalidValue('foo') ->setCode(Form::NOT_SYNCHRONIZED_ERROR) - ->setCause($is2Dot4Api ? null : $form->getTransformationFailure()) + ->setCause($this->context instanceof ExecutionContextInterface ? $form->getTransformationFailure() : null) ->assertRaised(); } @@ -261,14 +260,12 @@ class FormValidatorTest extends AbstractConstraintValidatorTest $this->validator->validate($form, new Form()); - $is2Dot4Api = Validation::API_VERSION_2_4 === $this->getApiVersion(); - $this->buildViolation('invalid_message_key') ->setParameter('{{ value }}', 'foo') ->setParameter('{{ foo }}', 'bar') ->setInvalidValue('foo') ->setCode(Form::NOT_SYNCHRONIZED_ERROR) - ->setCause($is2Dot4Api ? null : $form->getTransformationFailure()) + ->setCause($this->context instanceof ExecutionContextInterface ? $form->getTransformationFailure() : null) ->assertRaised(); } @@ -298,13 +295,11 @@ class FormValidatorTest extends AbstractConstraintValidatorTest $this->validator->validate($form, new Form()); - $is2Dot4Api = Validation::API_VERSION_2_4 === $this->getApiVersion(); - $this->buildViolation('invalid_message_key') ->setParameter('{{ value }}', 'foo') ->setInvalidValue('foo') ->setCode(Form::NOT_SYNCHRONIZED_ERROR) - ->setCause($is2Dot4Api ? null : $form->getTransformationFailure()) + ->setCause($this->context instanceof ExecutionContextInterface ? $form->getTransformationFailure() : null) ->assertRaised(); }