Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch '2.1'

* 2.1: (24 commits)
  updated license year
  Update src/Symfony/Component/HttpFoundation/Response.php
  [Form] Fixed inheritance of "error_bubbling" in RepeatedType
  [Form] Fixed DateType when used with the intl extension disabled.
  [HttpFoundation] fix return types and handling of zero in Response
  [HttpFoundation] better fix for non-parseable Expires header date
  Fixed missing plural message in portuguese validator
  Fix Expires when the header is -1
  [DoctrineBridge] Allowing memcache port to be 0 to support memcache unix domain sockets.
  [Console] fixed unitialized properties (closes #5935)
  [Process] Prevented test from failing when pcntl extension is not enabled.
  Revert "[DoctrineBridge] Improved performance of the EntityType when used with the "query_builder" option"
  [Form] Fixed failing tests for DateTimeToStringTransformer.
  [Locale] Fixed the StubLocaleTest for ICU versions lower than 4.8.
  [Bundle] [FrameworkBundle] fixed typo in phpdoc of the SessionListener.
  [Form] Fixed test regression introduced in #6440
  [Tests] Fix namespaces
  Fixed php doc of GenericEvent::__construct
  HttpUtils must handle RequestMatcher too
  use preferred_choices in favor of preferred_query
  ...

Conflicts:
	src/Symfony/Bridge/Propel1/Form/ChoiceList/ModelChoiceList.php
  • Loading branch information...
commit 6808a0d2cd3153ed02b71e58782a4a08be297f8d 2 parents 145bc5f + 5486bbb
Fabien Potencier fabpot authored
2  Extension/Core/Type/DateType.php
View
@@ -83,7 +83,7 @@ public function buildForm(FormBuilderInterface $builder, array $options)
// Only pass a subset of the options to children
$yearOptions['choices'] = $this->formatTimestamps($formatter, '/y+/', $this->listYears($options['years']));
$yearOptions['empty_value'] = $options['empty_value']['year'];
- $monthOptions['choices'] = $this->formatTimestamps($formatter, '/M+/', $this->listMonths($options['months']));
+ $monthOptions['choices'] = $this->formatTimestamps($formatter, '/[M|L]+/', $this->listMonths($options['months']));
$monthOptions['empty_value'] = $options['empty_value']['month'];
$dayOptions['choices'] = $this->formatTimestamps($formatter, '/d+/', $this->listDays($options['days']));
$dayOptions['empty_value'] = $options['empty_value']['day'];
4 Extension/Core/Type/RepeatedType.php
View
@@ -27,6 +27,10 @@ public function buildForm(FormBuilderInterface $builder, array $options)
$options['first_options']['required'] = $options['required'];
$options['second_options']['required'] = $options['required'];
+ if (!isset($options['options']['error_bubbling'])) {
+ $options['options']['error_bubbling'] = $options['error_bubbling'];
+ }
+
$builder
->addViewTransformer(new ValueToDuplicatesTransformer(array(
$options['first_name'],
6 Tests/Extension/Core/DataTransformer/DateTimeToStringTransformerTest.php
View
@@ -23,7 +23,7 @@ public function dataProvider()
array('Y-m-d H:i', '2010-02-03 16:05', '2010-02-03 16:05:00 UTC'),
array('Y-m-d H', '2010-02-03 16', '2010-02-03 16:00:00 UTC'),
array('Y-m-d', '2010-02-03', '2010-02-03 00:00:00 UTC'),
- array('Y-m', '2010-02', '2010-02-01 00:00:00 UTC'),
+ array('Y-m', '2010-12', '2010-12-01 00:00:00 UTC'),
array('Y', '2010', '2010-01-01 00:00:00 UTC'),
array('d-m-Y', '03-02-2010', '2010-02-03 00:00:00 UTC'),
array('H:i:s', '16:05:06', '1970-01-01 16:05:06 UTC'),
@@ -111,11 +111,11 @@ public function testTransformExpectsDateTime()
*/
public function testReverseTransformUsingPipe($format, $input, $output)
{
- if (version_compare(phpversion(), '5.3.7', '>=')) {
+ if (version_compare(phpversion(), '5.3.7', '<')) {
$this->markTestSkipped('Pipe usage requires PHP 5.3.7 or newer.');
}
- $reverseTransformer = new DateTimeToStringTransformer('UTC', 'UTC', $format, false);
+ $reverseTransformer = new DateTimeToStringTransformer('UTC', 'UTC', $format, true);
$output = new \DateTime($output);
35 Tests/Extension/Core/Type/RepeatedTypeTest.php
View
@@ -72,6 +72,41 @@ public function testSetRequired()
$this->assertFalse($form['second']->isRequired());
}
+ public function testSetErrorBubblingToTrue()
+ {
+ $form = $this->factory->create('repeated', null, array(
+ 'error_bubbling' => true,
+ ));
+
+ $this->assertTrue($form->getConfig()->getOption('error_bubbling'));
+ $this->assertTrue($form['first']->getConfig()->getOption('error_bubbling'));
+ $this->assertTrue($form['second']->getConfig()->getOption('error_bubbling'));
+ }
+
+ public function testSetErrorBubblingToFalse()
+ {
+ $form = $this->factory->create('repeated', null, array(
+ 'error_bubbling' => false,
+ ));
+
+ $this->assertFalse($form->getConfig()->getOption('error_bubbling'));
+ $this->assertFalse($form['first']->getConfig()->getOption('error_bubbling'));
+ $this->assertFalse($form['second']->getConfig()->getOption('error_bubbling'));
+ }
+
+ public function testSetErrorBubblingIndividually()
+ {
+ $form = $this->factory->create('repeated', null, array(
+ 'error_bubbling' => true,
+ 'options' => array('error_bubbling' => false),
+ 'second_options' => array('error_bubbling' => true),
+ ));
+
+ $this->assertTrue($form->getConfig()->getOption('error_bubbling'));
+ $this->assertFalse($form['first']->getConfig()->getOption('error_bubbling'));
+ $this->assertTrue($form['second']->getConfig()->getOption('error_bubbling'));
+ }
+
public function testSetOptionsPerChildAndOverwrite()
{
$form = $this->factory->create('repeated', null, array(
Please sign in to comment.
Something went wrong with that request. Please try again.