Merge branch '2.6' into 2.7
This commit is contained in:
commit
dd504d4adf
@ -57,7 +57,7 @@
|
||||
{%- endif -%}
|
||||
<select {{ block('widget_attributes') }}{% if multiple %} multiple="multiple"{% endif %}>
|
||||
{%- if placeholder is not none -%}
|
||||
<option value=""{% if required and value is empty %} selected="selected"{% endif %}>{{ placeholder|trans({}, translation_domain) }}</option>
|
||||
<option value=""{% if required and value is empty %} selected="selected"{% endif %}>{{ placeholder != '' ? placeholder|trans({}, translation_domain) }}</option>
|
||||
{%- endif -%}
|
||||
{%- if preferred_choices|length > 0 -%}
|
||||
{% set options = preferred_choices %}
|
||||
|
@ -7,7 +7,7 @@
|
||||
)) ?>
|
||||
<?php if ($multiple): ?> multiple="multiple"<?php endif ?>
|
||||
>
|
||||
<?php if (null !== $placeholder): ?><option value=""<?php if ($required and empty($value) && "0" !== $value): ?> selected="selected"<?php endif?>><?php echo $view->escape($view['translator']->trans($placeholder, array(), $translation_domain)) ?></option><?php endif; ?>
|
||||
<?php if (null !== $placeholder): ?><option value=""<?php if ($required and empty($value) && '0' !== $value): ?> selected="selected"<?php endif?>><?php echo '' != $placeholder ? $view->escape($view['translator']->trans($placeholder, array(), $translation_domain)) : '' ?></option><?php endif; ?>
|
||||
<?php if (count($preferred_choices) > 0): ?>
|
||||
<?php echo $view['form']->block($form, 'choice_widget_options', array('choices' => $preferred_choices)) ?>
|
||||
<?php if (count($choices) > 0 && null !== $separator): ?>
|
||||
|
@ -107,7 +107,7 @@ class ResizeFormListener implements EventSubscriberInterface
|
||||
}
|
||||
|
||||
if (!is_array($data) && !($data instanceof \Traversable && $data instanceof \ArrayAccess)) {
|
||||
throw new UnexpectedTypeException($data, 'array or (\Traversable and \ArrayAccess)');
|
||||
$data = array();
|
||||
}
|
||||
|
||||
// Remove all empty rows
|
||||
|
@ -359,7 +359,7 @@ abstract class AbstractBootstrap3LayoutTest extends AbstractLayoutTest
|
||||
[@class="my&class form-control"]
|
||||
[not(@required)]
|
||||
[
|
||||
./option[@value=""][.="[trans][/trans]"]
|
||||
./option[@value=""][.=""]
|
||||
/following-sibling::option[@value="&a"][@selected="selected"][.="[trans]Choice&A[/trans]"]
|
||||
/following-sibling::option[@value="&b"][not(@selected)][.="[trans]Choice&B[/trans]"]
|
||||
]
|
||||
@ -383,7 +383,7 @@ abstract class AbstractBootstrap3LayoutTest extends AbstractLayoutTest
|
||||
[@class="my&class form-control"]
|
||||
[not(@required)]
|
||||
[
|
||||
./option[@value=""][.="[trans][/trans]"]
|
||||
./option[@value=""][.=""]
|
||||
/following-sibling::option[@value="&a"][not(@selected)][.="[trans]Choice&A[/trans]"]
|
||||
/following-sibling::option[@value="&b"][not(@selected)][.="[trans]Choice&B[/trans]"]
|
||||
]
|
||||
@ -457,7 +457,7 @@ abstract class AbstractBootstrap3LayoutTest extends AbstractLayoutTest
|
||||
[@class="my&class form-control"]
|
||||
[@required="required"]
|
||||
[
|
||||
./option[@value=""][not(@selected)][not(@disabled)][.="[trans][/trans]"]
|
||||
./option[@value=""][not(@selected)][not(@disabled)][.=""]
|
||||
/following-sibling::option[@value="&a"][@selected="selected"][.="[trans]Choice&A[/trans]"]
|
||||
/following-sibling::option[@value="&b"][not(@selected)][.="[trans]Choice&B[/trans]"]
|
||||
]
|
||||
@ -1278,17 +1278,17 @@ abstract class AbstractBootstrap3LayoutTest extends AbstractLayoutTest
|
||||
./select
|
||||
[@id="name_month"]
|
||||
[@class="form-control"]
|
||||
[./option[@value=""][not(@selected)][not(@disabled)][.="[trans][/trans]"]]
|
||||
[./option[@value=""][not(@selected)][not(@disabled)][.=""]]
|
||||
[./option[@value="1"][@selected="selected"]]
|
||||
/following-sibling::select
|
||||
[@id="name_day"]
|
||||
[@class="form-control"]
|
||||
[./option[@value=""][not(@selected)][not(@disabled)][.="[trans][/trans]"]]
|
||||
[./option[@value=""][not(@selected)][not(@disabled)][.=""]]
|
||||
[./option[@value="1"][@selected="selected"]]
|
||||
/following-sibling::select
|
||||
[@id="name_year"]
|
||||
[@class="form-control"]
|
||||
[./option[@value=""][not(@selected)][not(@disabled)][.="[trans][/trans]"]]
|
||||
[./option[@value=""][not(@selected)][not(@disabled)][.=""]]
|
||||
[./option[@value="1950"][@selected="selected"]]
|
||||
]
|
||||
[count(./select)=3]
|
||||
|
@ -635,7 +635,7 @@ abstract class AbstractLayoutTest extends \Symfony\Component\Form\Test\FormInteg
|
||||
[@name="name"]
|
||||
[not(@required)]
|
||||
[
|
||||
./option[@value=""][.="[trans][/trans]"]
|
||||
./option[@value=""][.=""]
|
||||
/following-sibling::option[@value="&a"][@selected="selected"][.="[trans]Choice&A[/trans]"]
|
||||
/following-sibling::option[@value="&b"][not(@selected)][.="[trans]Choice&B[/trans]"]
|
||||
]
|
||||
@ -658,7 +658,7 @@ abstract class AbstractLayoutTest extends \Symfony\Component\Form\Test\FormInteg
|
||||
[@name="name"]
|
||||
[not(@required)]
|
||||
[
|
||||
./option[@value=""][.="[trans][/trans]"]
|
||||
./option[@value=""][.=""]
|
||||
/following-sibling::option[@value="&a"][not(@selected)][.="[trans]Choice&A[/trans]"]
|
||||
/following-sibling::option[@value="&b"][not(@selected)][.="[trans]Choice&B[/trans]"]
|
||||
]
|
||||
@ -735,7 +735,7 @@ abstract class AbstractLayoutTest extends \Symfony\Component\Form\Test\FormInteg
|
||||
[@name="name"]
|
||||
[@required="required"]
|
||||
[
|
||||
./option[@value=""][not(@selected)][not(@disabled)][.="[trans][/trans]"]
|
||||
./option[@value=""][not(@selected)][not(@disabled)][.=""]
|
||||
/following-sibling::option[@value="&a"][@selected="selected"][.="[trans]Choice&A[/trans]"]
|
||||
/following-sibling::option[@value="&b"][not(@selected)][.="[trans]Choice&B[/trans]"]
|
||||
]
|
||||
@ -1442,15 +1442,15 @@ abstract class AbstractLayoutTest extends \Symfony\Component\Form\Test\FormInteg
|
||||
[
|
||||
./select
|
||||
[@id="name_month"]
|
||||
[./option[@value=""][not(@selected)][not(@disabled)][.="[trans][/trans]"]]
|
||||
[./option[@value=""][not(@selected)][not(@disabled)][.=""]]
|
||||
[./option[@value="1"][@selected="selected"]]
|
||||
/following-sibling::select
|
||||
[@id="name_day"]
|
||||
[./option[@value=""][not(@selected)][not(@disabled)][.="[trans][/trans]"]]
|
||||
[./option[@value=""][not(@selected)][not(@disabled)][.=""]]
|
||||
[./option[@value="1"][@selected="selected"]]
|
||||
/following-sibling::select
|
||||
[@id="name_year"]
|
||||
[./option[@value=""][not(@selected)][not(@disabled)][.="[trans][/trans]"]]
|
||||
[./option[@value=""][not(@selected)][not(@disabled)][.=""]]
|
||||
[./option[@value="1950"][@selected="selected"]]
|
||||
]
|
||||
[count(./select)=3]
|
||||
|
@ -167,15 +167,14 @@ class ResizeFormListenerTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertFalse($this->form->has('2'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \Symfony\Component\Form\Exception\UnexpectedTypeException
|
||||
*/
|
||||
public function testPreSubmitRequiresArrayOrTraversable()
|
||||
public function testPreSubmitDealsWithNoArrayOrTraversable()
|
||||
{
|
||||
$data = 'no array or traversable';
|
||||
$event = new FormEvent($this->form, $data);
|
||||
$listener = new ResizeFormListener('text', array(), false, false);
|
||||
$listener->preSubmit($event);
|
||||
|
||||
$this->assertFalse($this->form->has('1'));
|
||||
}
|
||||
|
||||
public function testPreSubmitDealsWithNullData()
|
||||
|
@ -40,7 +40,7 @@
|
||||
</trans-unit>
|
||||
<trans-unit id="10">
|
||||
<source>This field is missing.</source>
|
||||
<target>Questo campo è manca.</target>
|
||||
<target>Questo campo è mancante.</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="11">
|
||||
<source>This value is not a valid date.</source>
|
||||
|
Reference in New Issue
Block a user