Commit Graph

1115 Commits

Author SHA1 Message Date
Artem Lopata (bumz)
89975ef9d6 Added more verbose message for exception when form types have wrong getName method 2012-07-18 12:37:22 +03:00
Bernhard Schussek
1474aa5fa2 [Form] Fixed consideration of Twig's template inheritance and added another performance-improving check 2012-07-17 09:02:04 +02:00
Bernhard Schussek
b4ec7f54eb Fixed my rubbish English 2012-07-16 21:54:46 +02:00
Bernhard Schussek
d11f8b5e9e [Form] Fixed passing of variables in the FormRenderer 2012-07-16 21:39:30 +02:00
Bernhard Schussek
629093ed25 [Form] Extracted common parts of FormHelper and FormExtension into separate classes 2012-07-16 21:39:27 +02:00
Bilal Amarni
b4d1bdf9e6 [Form] added a bc break note about the tag alias matching 2012-07-15 16:34:11 +03:00
Fabien Potencier
cd24e6ea8f Revert "raised the minimum version of PHP to 5.3.4 (closes #3856)"
This reverts commit 2dcc44897e.
2012-07-15 12:13:51 +02:00
Alexander
33f29ed174 [Form] '@group benchmark' for form performance tests 2012-07-14 16:20:31 +02:00
Yaroslav Kiliba
dbd169f82e [Form] Error in the SimpleFormTest case. 2012-07-14 16:02:46 +03:00
Fabien Potencier
c99b10804b merged branch stof/form_safeguard (PR #4910)
Commits
-------

6489a65 [Form] Added an exception for invalid type services

Discussion
----------

[Form] Added an exception for invalid type services

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes [![Build Status](https://secure.travis-ci.org/stof/symfony.png?branch=form_safeguard)](http://travis-ci.org/stof/symfony) (Travis fails randomly for the performance test)
Fixes the following tickets: -
Todo: -

Before the introduction of the FormRegistry, the getName() method was
never used for types registered through the DI container. The
FormRegistry now uses the getName() method and missconfigured services
will trigger a notice.
This was reported in FriendsOfSymfony/FOSCommentBundle#234
2012-07-14 13:41:41 +02:00
Christophe Coevoet
6489a65960 [Form] Added an exception for invalid type services
Before the introduction of the FormRegistry, the getName() method was
never used for types registered through the DI container. The
FormRegistry now uses the getName() method and missconfigured services
will trigger a notice.
This was reported in FriendsOfSymfony/FOSCommentBundle#234
2012-07-14 13:04:03 +02:00
Bernhard Schussek
69e5e58629 [Form] Individual rows of CollectionType cannot be styled anymore for performance reasons 2012-07-14 12:10:29 +02:00
Tobias Schultze
ffd8c1e773 [Form] add thrown exceptions to FormRegistryInterface 2012-07-14 00:14:36 +03:00
Fabien Potencier
a27aeda8f4 merged branch bschussek/performance (PR #4882)
Commits
-------

cd7835d [Form] Cached the form type hierarchy in order to improve performance
2ca753b [Form] Fixed choice list hashing in DoctrineType
2bf4d6c [Form] Fixed FormFactory not to set "data" option if not explicitely given
7149d26 [Form] Removed invalid PHPDoc text

Discussion
----------

[Form] WIP Improved performance of form building

Bug fix: no
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
Todo: **Update the Silex extension**

This PR is work in progress and up for discussion. It increases the performance of FormFactory::createForm() on a specific, heavy-weight form from **0.848** to **0.580** seconds.

Before, the FormFactory had to traverse the hierarchy and calculate the default options of each FormType everytime a form was created of that type.

Now, FormTypes are wrapped within instances of a new class `ResolvedFormType`, which caches the parent type, the type's extensions and its default options.

The updated responsibilities: `FormFactory` is a registry and proxy for `ResolvedFormType` objects, `FormType` specifies how a form can be built on a specific layer of the type hierarchy (e.g. "form", or "date", etc.) and `ResolvedFormType` *does the actual building* across all layers of the hierarchy (by delegating to the parent type, which delegates to its parent type etc.).

---------------------------------------------------------------------------

by schmittjoh at 2012-07-12T18:25:40Z

Maybe ResolvedFormType

---------------------------------------------------------------------------

by jmather at 2012-07-13T02:56:38Z

I really like ResolvedFormType. That's the naming method I took for my tag parser that handes the same conceptual issue.

---------------------------------------------------------------------------

by axelarge at 2012-07-13T05:25:00Z

ResolvedFormType sounds very clear.
This change is great and I desperately hope to see more of this kind

---------------------------------------------------------------------------

by Baachi at 2012-07-13T06:41:26Z

Yes `ResolvedFormType` sounds good :) 👍

---------------------------------------------------------------------------

by fabpot at 2012-07-13T07:11:33Z

I like `ResolvedFormType` as well.

---------------------------------------------------------------------------

by henrikbjorn at 2012-07-13T07:46:48Z

👍 `ResolvedFormType` :shipit:

---------------------------------------------------------------------------

by stof at 2012-07-13T18:01:51Z

This looks good to me
2012-07-13 21:26:31 +02:00
Fabien Potencier
2dcc44897e raised the minimum version of PHP to 5.3.4 (closes #3856)
We've raised the minimum version of PHP because of a PHP
bug before 5.3.4:

https://bugs.php.net/bug.php?id=52083
https://bugs.php.net/bug.php?id=50027
2012-07-13 21:22:46 +02:00
Bernhard Schussek
cd7835d8d2 [Form] Cached the form type hierarchy in order to improve performance 2012-07-13 20:39:30 +02:00
Bernhard Schussek
2bf4d6cff4 [Form] Fixed FormFactory not to set "data" option if not explicitely given 2012-07-13 12:12:25 +02:00
Bernhard Schussek
7149d268b6 [Form] Removed invalid PHPDoc text 2012-07-12 19:41:56 +02:00
Bernhard Schussek
8298d8c260 [Form] Improved ChoiceType performance by caching ChoiceList objects 2012-07-12 12:35:56 +02:00
Bernhard Schussek
c919b81ca9 [Form] Fixed TransformationFailedExceptions to be caught in the model transformers 2012-07-11 16:50:44 +02:00
Bernhard Schussek
f06203a640 [Form] Improved ValidatorTypeGuesser to interpret the constraints True and False 2012-07-11 16:46:06 +02:00
Bernhard Schussek
d661837ec0 [Validator] Reverted the changes done to the Size constraint in 3a5e84f4a7 2012-07-11 11:43:13 +02:00
Bernhard Schussek
d84b689529 [Validator] Added the constraints MinCount and MaxCount 2012-07-11 11:43:13 +02:00
Bernhard Schussek
1a732e4983 [Validator] Removed the Range constraint as it duplicates functionality given in Min and Max 2012-07-11 11:43:13 +02:00
Bernhard Schussek
92abf5aace [Form] Enabled error bubbling from the parts of a date/time field to the main field 2012-07-11 10:34:15 +02:00
Bernhard Schussek
7a76dbad20 [Form] Renamed the options "data_timezone" and "user_timezone" 2012-07-11 09:44:09 +02:00
Bernhard Schussek
655d645568 [Form] Fixed tests failing on systems with timezones other than +01:00 2012-07-11 09:34:01 +02:00
Bernhard Schussek
ded6c0305c [Form] DateTimeType now handles RFC 3339 dates as provided by HTML5 2012-07-11 09:06:31 +02:00
Bernhard Schussek
7e8b622802 [Form] Added the option "format" to DateTimeType 2012-07-10 17:23:19 +02:00
Bernhard Schussek
9eeb20044f [Form] Changed the default format of DateType to "yyyy-MM-dd" to support HTML 5 out of the box 2012-07-10 16:10:57 +02:00
Bernhard Schussek
d621a76f28 [Form] Improved DateTimeType code 2012-07-10 15:18:47 +02:00
Bernhard Schussek
5b057f89b0 [Form] Fixed DateType to use "format" for creating the year and day choices 2012-07-10 14:53:17 +02:00
Fabien Potencier
5487a1f076 merged branch ChrisTickner/formbuilder_remove_bug_fix (PR #4826)
Commits
-------

f71e2a8 [Form] FormBuilder Bug Fix: remove() was not properly removing children

Discussion
----------

[Form] FormBuilder Bug Fix: remove() was not properly removing children

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: #4803
License of the code: MIT

FormBuilder initially sets unresolved children as NULL, until resolved.
 If FormBuilder::remove() is called before that child is resolved, the
if statement turns false, because isset(null) is false, when it should
be true.  Instead, we should check to see if the key exists, and if so,
process and unset it.

Closes #4803

---------------------------------------------------------------------------

by bschussek at 2012-07-10T07:41:55Z

Can you please add a test covering this case?

---------------------------------------------------------------------------

by ChrisTickner at 2012-07-10T09:43:07Z

Sure, added a test case.  It fails before the patch and passes after.

---------------------------------------------------------------------------

by bschussek at 2012-07-10T09:47:06Z

Thanks. Can you please add a comment to the test with the URL of this PR? Also, please squash your commits into one when your done.

---------------------------------------------------------------------------

by ChrisTickner at 2012-07-10T10:02:16Z

Oops, I deleted the remote branch and re-pushed without realizing we'd lose some history on this PR page.  Live and learn I suppose.

---------------------------------------------------------------------------

by bschussek at 2012-07-10T10:18:20Z

Thanks!
2012-07-10 12:18:45 +02:00
Chris Tickner
f71e2a8c7a [Form] FormBuilder Bug Fix: remove() was not properly removing children
FormBuilder initially sets unresolved children as NULL, until resolved.
 If FormBuilder::remove() is called before that child is resolved, the
if statement turns false, because isset(null) is false, when it should
be true.  Instead, we should check to see if the key exists, and if so,
process and unset it.

Closes #4803
2012-07-10 06:56:48 -03:00
Bernhard Schussek
87fe4871cd Revert "[Form] Add default validation to TextType field (and related)"
This reverts commit 49d2685bff.

Conflicts:

	src/Symfony/Component/Form/Extension/Core/DataTransformer/ValueToStringTransformer.php
	src/Symfony/Component/Form/Extension/Core/Type/TextType.php
	src/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/ValueToStringTransformerTest.php
	src/Symfony/Component/Form/Tests/Extension/Core/Type/UrlTypeTest.php
2012-07-10 11:56:29 +02:00
Fabien Potencier
7f0274462f merged branch SamsonIT/property_path_error (PR #4829)
Commits
-------

6ad4018 [Form] Also display the hint about adder/remover on invalid property access

Discussion
----------

[Form] Also display the hint about adder/remover on invalid property access

Bug fix: no
Feature addition: yes
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -

This PR follows up #4777. In this case the hint about adders and removers is also added when a property is found, but is not public, a common case.
2012-07-10 10:52:04 +02:00
Bernhard Schussek
c6cb8b2855 [Form] Removed unused option "inline" that was introduced by accident 2012-07-10 10:49:15 +02:00
Bart van den Burg
6ad4018ff5 [Form] Also display the hint about adder/remover on invalid property access 2012-07-10 10:23:34 +02:00
Bernhard Schussek
e8bb834a54 [Form] Fixed data to be written back by PropertyPath if it cannot be handled by reference 2012-07-10 09:38:32 +02:00
Fabien Potencier
4bab36b2c7 merged branch bschussek/issue3899 (PR #4813)
Commits
-------

9c94b48 [Form] Fixed the "data" option to supersede default data set in the model

Discussion
----------

[Form] Fixed the "data" option to supersede default data set in the model

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: #3899
Todo: -
2012-07-10 08:22:37 +02:00
Fabien Potencier
feab81117b merged branch bschussek/bind_request (PR #4811)
Commits
-------

7727de7 [Form] Deprecated Form::bindRequest() and replaced it by a PRE_BIND listener

Discussion
----------

[Form] Deprecated Form::bindRequest() and replaced it by a PRE_BIND listener

Bug fix: no
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: -
Todo: -

Instead of `bindRequest`, you should now simply call `bind`:

Before:

```
$form->bindRequest($request);
```

After:

```
$form->bind($request);
```
2012-07-10 08:21:54 +02:00
Fabien Potencier
578d799dc8 merged branch umpirsky/patch-3 (PR #4815)
Commits
-------

55ac686 Serbian Latin translation updated.

Discussion
----------

Serbian Latin translation updated.
2012-07-10 07:45:54 +02:00
Саша Стаменковић
55ac686f6c Serbian Latin translation updated. 2012-07-09 23:42:28 +03:00
Саша Стаменковић
ec8c023143 Serbian Cyrillic translation updated. 2012-07-09 23:42:25 +03:00
Bernhard Schussek
9c94b48eeb [Form] Fixed the "data" option to supersede default data set in the model 2012-07-09 21:04:24 +02:00
Bernhard Schussek
7727de73e5 [Form] Deprecated Form::bindRequest() and replaced it by a PRE_BIND listener 2012-07-09 20:34:45 +02:00
Bernhard Schussek
c0a520792b [Form] Prevented duplicate validation of form constraints 2012-07-09 19:28:39 +02:00
Fabien Potencier
22fea110a5 merged branch bschussek/revert_circ_ref (PR #4807)
Commits
-------

eba7dfe Revert "[Form] added a circular reference safeguard for form type"

Discussion
----------

Revert "[Form] added a circular reference safeguard for form type"

This reverts commit ea93e4cafa.

Conflicts:

	src/Symfony/Component/Form/FormBuilder.php
	src/Symfony/Component/Form/FormFactory.php
2012-07-09 18:45:58 +02:00
Bernhard Schussek
eba7dfeb8a Revert "[Form] added a circular reference safeguard for form type"
This reverts commit ea93e4cafa.

Conflicts:

	src/Symfony/Component/Form/FormBuilder.php
	src/Symfony/Component/Form/FormFactory.php
2012-07-09 18:42:18 +02:00
Fabien Potencier
2cf1a0a7e8 merged branch bschussek/issue4615 (PR #4799)
Commits
-------

df5bb4a [Form] Unified rendering of errors for nested elements

Discussion
----------

[Form] Unified rendering of errors for nested elements

Bug fix: yes
Feature addition: no
Backwards compatibility break: yes?
Symfony2 tests pass: yes
Fixes the following tickets: #4615
Todo: -
2012-07-09 18:41:53 +02:00