Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch '2.1'

* 2.1:
  [Console] Fix style escaping parsing
  [Console] Make style formatter matching less greedy to avoid having to escape when not needed
  [Bundle] [FrameworkBundle] fixed indentation in esi.xml services file.
  [Component] [Security] fixed PSR-2 coding violation in ClassUtilsTest class.
  [Form] Fixed EntityChoiceList when loading objects with negative integer IDs
  [TwigBundle] There is no CSS visibility of display, should be visible instead
  [Form] corrected source node for a Danish translation
  [DependencyInjection] fixed a bug where the strict flag on references were lost (closes #6607)
  [HttpFoundation] Check if required shell functions for `FileBinaryMimeTypeGuesser` are not disabled
  [CssSelector] added css selector with empty string
  [HttpFoundation] Docblock for Request::isXmlHttpRequest() now points to Wikipedia
  [DependencyInjection] refactored code to avoid logic duplication
  [Form] Deleted references in FormBuilder::getFormConfig() to improve performance
  [HttpFoundation] Update docblock for non-working method

Conflicts:
	src/Symfony/Bundle/TwigBundle/Resources/views/Exception/trace.html.twig
	src/Symfony/Bundle/TwigBundle/Resources/views/Exception/traces.html.twig
  • Loading branch information...
commit ed430980cdc9901b8e38a8c794ead7306282f547 2 parents bd5c0e0 + 542ace2
@fabpot fabpot authored
View
15 FormBuilder.php
@@ -207,6 +207,21 @@ public function count()
/**
* {@inheritdoc}
*/
+ public function getFormConfig()
+ {
+ $config = parent::getFormConfig();
+
+ $config->factory = null;
+ $config->parent = null;
+ $config->children = array();
+ $config->unresolvedChildren = array();
+
+ return $config;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
public function getForm()
{
if ($this->locked) {
View
2  Resources/translations/validators.da.xlf
@@ -11,7 +11,7 @@
<target>Den oploadede fil var for stor. Opload venligst en mindre fil.</target>
</trans-unit>
<trans-unit id="30">
- <source>The CSRF token is invalid.</source>
+ <source>The CSRF token is invalid. Please try to resubmit the form.</source>
<target>CSRF nøglen er ugyldig.</target>
</trans-unit>
</body>
View
24 Tests/FormBuilderTest.php
@@ -239,6 +239,30 @@ public function testGetParentForCreatedBuilder()
$this->builder->create('bar', 'text');
}
+ public function testGetFormConfigErasesReferences()
+ {
+ $builder = new FormBuilder('name', null, $this->dispatcher, $this->factory);
+ $builder->setParent(new FormBuilder('parent', null, $this->dispatcher, $this->factory));
+ $builder->add(new FormBuilder('child', null, $this->dispatcher, $this->factory));
+
+ $config = $builder->getFormConfig();
+ $reflClass = new \ReflectionClass($config);
+ $factory = $reflClass->getProperty('factory');
+ $parent = $reflClass->getProperty('parent');
+ $children = $reflClass->getProperty('children');
+ $unresolvedChildren = $reflClass->getProperty('unresolvedChildren');
+
+ $factory->setAccessible(true);
+ $parent->setAccessible(true);
+ $children->setAccessible(true);
+ $unresolvedChildren->setAccessible(true);
+
+ $this->assertNull($factory->getValue($config));
+ $this->assertNull($parent->getValue($config));
+ $this->assertEmpty($children->getValue($config));
+ $this->assertEmpty($unresolvedChildren->getValue($config));
+ }
+
private function getFormBuilder($name = 'name')
{
$mock = $this->getMockBuilder('Symfony\Component\Form\FormBuilder')
Please sign in to comment.
Something went wrong with that request. Please try again.