Commits
-------
2c19b3c Empty shortcut check in the constructor
cf9039e Added a unit test for the shortcut name of the InputOption class
Discussion
----------
[Console] Single dash for option shortcuts
See https://github.com/symfony/symfony/pull/4062
---------------------------------------------------------------------------
by travisbot at 2012-05-20T13:09:18Z
This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1380389) (merged 02290da4 into f433f6b0).
---------------------------------------------------------------------------
by stof at 2012-05-20T13:16:34Z
please rebase your branch to get rid of these merge commits
btw, you should use feature branches to send your next pull requests instead of using your master branch each time, which limits you to a single PR.
---------------------------------------------------------------------------
by Nanocom at 2012-05-20T13:39:32Z
Sorry for the mess, cleaning it
---------------------------------------------------------------------------
by travisbot at 2012-05-20T13:41:46Z
This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1380549) (merged 63129657 into f433f6b0).
---------------------------------------------------------------------------
by travisbot at 2012-05-20T13:43:07Z
This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1380553) (merged 2c19b3c7 into f433f6b0).
Commits
-------
23bad29 Added translation to placeholder and title attributes
Discussion
----------
Added translation to placeholder and title attributes
---------------------------------------------------------------------------
by schmittjoh at 2012-05-03T13:52:38Z
Better translate it where it is defined.
Dynamic translations are usually not desirable as they cannot be automatically extracted, and thus require more work.
---------------------------------------------------------------------------
by ruimarinho at 2012-05-03T13:57:30Z
@schmittjoh but isn't that the same case as with labels for instance? I don't think injecting the translator service into the form type would require less work than what this PR suggests.
---------------------------------------------------------------------------
by schmittjoh at 2012-05-03T14:02:02Z
Yeah, same thing.
There might be some cases where it's fine, but in general, we should try to not translate dynamic vars.
---------------------------------------------------------------------------
by ruimarinho at 2012-05-03T14:17:44Z
@schmittjoh I think that's one of those cases, since these attributes in particular (title and placeholder) are intended to aid the user with a brief description. I understand (and agree) with your concern regarding dynamic vars, but in my opinion this is a use case where it is worth it. Just my two cents :)
---------------------------------------------------------------------------
by stof at 2012-05-03T18:07:01Z
@schmittjoh the issue is that translating the label before the template would require injecting the translator in the form types (as the form label can be set there) and would force the user to duplicate the translation process if they pass the label explicitly in the template.
Commits
-------
64101ab separate numeric value from suffix in File constraint's error message `$uploadIniSizeErrorMessage`
ff122d3 fixed tests
868d649 separate numeric values from suffixes in File constraint's error message `$maxSizeMessage`
Discussion
----------
[Validator] separate numeric values from suffixes in File validation error messages
This change allows me to locale-aware format the numbers in a form theme, i.e., to use a comma instead of a dot. If there's a better way without re-implementing the entire validator, let me know.
Such changes also allow for using a different separator than the usual space in translations.
---------------------------------------------------------------------------
by travisbot at 2012-05-08T19:14:16Z
This pull request [fails](http://travis-ci.org/symfony/symfony/builds/1278845) (merged f7c50098 into e54f4e46).
---------------------------------------------------------------------------
by travisbot at 2012-05-08T19:23:31Z
This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1278940) (merged ce1cdafc into e54f4e46).
---------------------------------------------------------------------------
by r1pp3rj4ck at 2012-05-10T11:05:18Z
I don't know if there is a better way to do this, but I like the idea anyway.
---------------------------------------------------------------------------
by craue at 2012-05-11T14:18:52Z
Separated numeric values and suffixes for `$maxSizeMessage` and `$uploadIniSizeErrorMessage` now. Can't find any other relevant places (in other validators). Might be merged if accepted.
---------------------------------------------------------------------------
by travisbot at 2012-05-11T14:19:10Z
This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1305246) (merged 438da7dd into e54f4e46).
---------------------------------------------------------------------------
by travisbot at 2012-05-11T21:22:25Z
This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1309277) (merged 64101aba into dd0da03c).
---------------------------------------------------------------------------
by sstok at 2012-05-13T13:29:07Z
Using the NumberFormatter class would be an option, but that would also add a dependency when using Validation as stand-alone so using the {{ suffix }} is a good idea.
---------------------------------------------------------------------------
by craue at 2012-05-13T14:15:54Z
Using a NumberFormatter (if available) directly in the validator might indeed be a good option. In either case, having the numeric value separated from its suffix looks cleaner.
---------------------------------------------------------------------------
by craue at 2012-05-19T13:36:00Z
@fabpot: Would you merge this?
Commits
-------
fe7b258 Removed unnecessary use statements
Discussion
----------
[BrowserKit] Removed unnecessary use statements
Merely a cosmetical fix. My IDE (PhpStorm) marks the `use Symfony\Component\BrowserKit\Client;` statement in `Symfony/Component/BrowserKit/Client.php` itself as an error.
I also removed the two other `use`s of classes from the same namespace.
---------------------------------------------------------------------------
by travisbot at 2012-05-18T11:27:02Z
This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1365455) (merged fe7b2583 into 1e15f210).
Commits
-------
46be121 added tokenDataExists() method to prevent loading complete profile structures upon writes
Discussion
----------
[HttpKernel] prevent loading complete profile structures upon writes
The abstract class "PdoProfilerStorage" uses its ::read() method to decide if a profiler record has to be updated or initially created upon a ::write() call. This possibly causes huge memory consumption, as ::read() recursively reads all existing profiles using ::createProfileFromData() calls. When handling many sub-request this may lead into either a "out of memory" or XDebug's "maximum nesting level reached" - whichever comes first.
To prevent this issue, I added a new protected method ::tokenDataExists() that simply checks whether a record for the token in question already exists in storage.
---------------------------------------------------------------------------
by travisbot at 2012-05-18T08:56:56Z
This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1364303) (merged 46be1212 into 1e15f210).
Commits
-------
bc7043f [Routing] removed unused constructor arguments in test classes
d81fdfe [Routing] fixed namespace of test classes
53aaf76 [Routing] removed unused property of Router
Discussion
----------
[Routing] removed unused property of Router
Test pass: yes
BC break: no
This PR removes an unused property ($defaults) of Router. The property was passed to the constructor of UrlMatcher and UrlGenerator although these classes don't accept this parameter at all. And the dumped equivalents of them (produced by PhpMatcherDumper/PhpGeneratorDumper) don't need this property either.
So passing the $defaults was wrong and the property is not used in any way.
The DI config does not define anything for this property either: [routing.xml](https://github.com/symfony/symfony/blob/master/src/Symfony/Bundle/FrameworkBundle/Resources/config/routing.xml#L52)
The second commit fixes the namespaces of test classes that were wrong.
The third commit removes false arguments in the test classes.
---------------------------------------------------------------------------
by travisbot at 2012-05-22T07:34:03Z
This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1397749) (merged bc7043f1 into e4e3ce6c).
Commits
-------
f883953 TypeGuess fixed for Date/Time constraints
41bed29 [Form] fixed invalid 'type' option in ValidatorTypeGuesser for Date/TimeFields
Discussion
----------
[Form] fixed invalid 'type' option in ValidatorTypeGuesser for Date/TimeFields
Automatic field type guessing breaks, if you use any of the Date/Time
constraints (i.e. Symfony\Component\Validator\Constraints\DateTime), since these field types have no 'type' option defined.
(See getDefaultOptions() in DateTimeType.php)
---------------------------------------------------------------------------
by travisbot at 2012-05-10T15:25:16Z
This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1296309) (merged 005bdbb0 into 68eca0f9).
---------------------------------------------------------------------------
by travisbot at 2012-05-18T15:50:39Z
This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1367774) (merged f8839532 into a04acc89).
---------------------------------------------------------------------------
by TonyMalz at 2012-05-18T15:58:57Z
@bschussek Ok, changed it to 'input'
---------------------------------------------------------------------------
by bschussek at 2012-05-22T08:18:27Z
👍
Commits
-------
4fa8e68 Add support for javascript object notation in allowed JSONP callback
Discussion
----------
Add support for javascript object notation in allowed JSONP callback
---------------------------------------------------------------------------
by travisbot at 2012-05-18T23:09:45Z
This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1371497) (merged 4fa8e68c into 18132c18).
Commits
-------
1422506 [Form] Clarified the usage of "constraints" in the UPGRADE file
af41a1a [Form] Fixed typos
ac69394 [Form] Allowed native framework errors to be mapped as well
59d6b55 [Form] Fixed: error mapping aborts if reaching an unsynchronized form
9eda5f5 [Form] Fixed: RepeatedType now maps all errors to the first field
215b687 [Form] Added capability to process "." rules in "error_mapping"
c9c4900 [Form] Fixed: errors are not mapped to unsynchronized forms anymore
c8b61d5 [Form] Renamed FormMapping to MappingRule and moved some logic there to make rules more extendable
d0d1fe6 [Form] Added more information to UPGRADE and CHANGELOG
0c09a0e [Form] Made $name parameters optional in PropertyPathBuilder:replaceBy(Index|Property)
081c643 [Form] Updated UPGRADE and CHANGELOG
bbffd1b [Form] Fixed index checks in PropertyPath classes
ea5ff77 [Form] Fixed issues mentioned in the PR comments
7a4ba52 [EventDispatcher] Added class UnmodifiableEventDispatcher
306324e [Form] Greatly improved the error mapping done in DelegatingValidationListener
8f7e2f6 [Validator] Fixed: @Valid does not recurse the traversal of collections anymore by default
5e87dd8 [Form] Added tests for the case when "property_path" is null or false. Instead of setting "property_path" to false, you should set "mapped" to false instead.
2301b15 [Form] Tightened PropertyPath validation to reject any empty value (such as false)
7ff2a9b Revert "[Form] removed a constraint in PropertyPath as the path can definitely be an empty string for errors attached on the main form (when using a constraint defined with the 'validation_constraint' option)"
860dd1f [Form] Adapted Form to create a deterministic property path by default
03f5058 [Form] Fixed property name in PropertyPathMapperTest
c2a243f [Form] Made PropertyPath deterministic: "[prop]" always refers to indices (array or ArrayAccess), "prop" always refers to properties
2996340 [Form] Extracted FormConfig class to simplify the Form's constructor
Discussion
----------
[Form] Improved the error mapping and made property paths deterministic
Bug fix: yes
Feature addition: no
Backwards compatibility break: **yes**
Symfony2 tests pass: yes
Fixes the following tickets: #1971, #2945, #3272, #3308, #3903, #4329
Probably fixes: #2729
Todo: -
This PR is ready for review.
The algorithm for assigning errors to forms in the form tree was improved a lot. Also the error mapping works better now. There are still a few features to be added (e.g. wildcards "*"), but these can be implemented now pretty easily.
This PR breaks PR in that a form explicitely needs to set the "data_class" option if it wants to map to an object and needs to leave that option empty if it wants to map to an array.
Furthermore, property paths must be deterministic now: `foo` now only maps to `(g|s)etFoo()`, but not the index `["foo"]` (array or ArrayAccess), while `[foo]` only maps to the latter but not the former. See #3903 for more information.
---------------------------------------------------------------------------
by travisbot at 2012-05-19T21:35:24Z
This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1377086) (merged 9e346990 into 22294617).
---------------------------------------------------------------------------
by Tobion at 2012-05-20T01:47:48Z
Good stuff in general :)
---------------------------------------------------------------------------
by bschussek at 2012-05-20T09:19:18Z
Fixed everything mentioned here so far.
---------------------------------------------------------------------------
by travisbot at 2012-05-20T09:22:22Z
This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1379548) (merged 49918bef into 22294617).
---------------------------------------------------------------------------
by Tobion at 2012-05-20T14:29:14Z
many occurences of two spaces after `@param` (should be only one space).
---------------------------------------------------------------------------
by Koc at 2012-05-20T14:40:18Z
Sorry, I'm cannot observe all changes for form component in 2.1, so I have a question:
```php
<?php
protected $isPrivate;
public function isPrivate() {}
public function setPrivate() {}
```
Is it possible validate this property with accessors/mutators from code above in 2.1 now?
---------------------------------------------------------------------------
by bschussek at 2012-05-20T14:41:09Z
The type after `@param` used to be aligned with the type of the `@return` tag. Let's get the PHPDoc-guidelines straight before nitpicking more on these trivialities.
---------------------------------------------------------------------------
by bschussek at 2012-05-20T14:42:34Z
@Koc Please move your question to the user mailing list, let's keep this PR on topic.
---------------------------------------------------------------------------
by bschussek at 2012-05-20T14:45:42Z
Fixed everything mentioned until now.
---------------------------------------------------------------------------
by travisbot at 2012-05-20T14:47:48Z
This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1380903) (merged 03d60a03 into f433f6b0).
---------------------------------------------------------------------------
by bschussek at 2012-05-20T15:18:12Z
CHANGELOG/UPGRADE is now updated.
---------------------------------------------------------------------------
by travisbot at 2012-05-20T15:19:39Z
This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1381047) (merged 48cc3eca into f433f6b0).
---------------------------------------------------------------------------
by Tobion at 2012-05-20T16:16:51Z
All the deprecated methods and changed constructor arguments should probably be mentioned in the changelog/upgrade.
---------------------------------------------------------------------------
by travisbot at 2012-05-21T07:31:47Z
This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1386621) (merged c0ef69a1 into 1407f112).
---------------------------------------------------------------------------
by travisbot at 2012-05-21T08:01:46Z
This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1386826) (merged 4f3fc1fe into 1407f112).
---------------------------------------------------------------------------
by travisbot at 2012-05-21T09:22:30Z
This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1387263) (merged e3675050 into 1407f112).
---------------------------------------------------------------------------
by bschussek at 2012-05-21T09:43:08Z
This PR now fixes#1971.
---------------------------------------------------------------------------
by travisbot at 2012-05-21T09:45:51Z
This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1387370) (merged de33f9ef into 1407f112).
---------------------------------------------------------------------------
by travisbot at 2012-05-21T11:06:53Z
This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1387838) (merged da3b562e into 1407f112).
---------------------------------------------------------------------------
by bschussek at 2012-05-21T11:07:45Z
This PR now fixes#2945.
---------------------------------------------------------------------------
by bschussek at 2012-05-21T15:33:33Z
Native errors (such as "invalid", "extra_fields" etc.) are now respected by the "error_mapping" option as well. The option "validation_constraint" was deprecated, "constraints" is its replacement and a lot handier, because it allows you to work easily with arrays.
```php
<?php
$builder
->add('name', 'text', array(
'constraints' => new NotBlank(),
))
->add('phoneNumber', 'text', array(
'constraints' => array(
new NotBlank(),
new MinLength(7),
new Type('numeric')
)
));
```
Ready for review again.
---------------------------------------------------------------------------
by travisbot at 2012-05-21T15:33:45Z
This pull request [fails](http://travis-ci.org/symfony/symfony/builds/1390239) (merged e162f56d into ea33d4d3).
---------------------------------------------------------------------------
by travisbot at 2012-05-21T15:40:02Z
This pull request [fails](http://travis-ci.org/symfony/symfony/builds/1390367) (merged e8729a7f into ea33d4d3).
---------------------------------------------------------------------------
by travisbot at 2012-05-21T16:06:03Z
This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1390663) (merged ef39aba4 into ea33d4d3).
---------------------------------------------------------------------------
by travisbot at 2012-05-22T08:54:36Z
This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1398153) (merged af41a1a5 into e4e3ce6c).
---------------------------------------------------------------------------
by travisbot at 2012-05-22T09:26:12Z
This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1398415) (merged 14225067 into e4e3ce6c).
This reverts commit 5182a0c2c4.
PropertyPath instances should be empty. If you have an empty property path string, there is no need to create a PropertyPath instance for it.
Conflicts:
tests/Symfony/Tests/Component/Form/PropertyPathTest.php
Commits
-------
5d1b366 [Form] fix PhpDoc
Discussion
----------
[Form] fix PhpDoc
---------------------------------------------------------------------------
by travisbot at 2012-05-21T02:31:56Z
This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1385372) (merged 5d1b3669 into 1407f112).
---------------------------------------------------------------------------
by vicb at 2012-05-21T05:44:03Z
have you used inheritdoc (over inheritDoc) on purpose ? (I must admin I haven't followed the CS discussion very closely)
---------------------------------------------------------------------------
by Tobion at 2012-05-21T16:16:48Z
Yes, inheritdoc is used on symfony. It's also the recommended way of phpdoc itself (all lower-case).
Commits
-------
0a3dd0f [Console] Check for existence of proc_open to fix#4338
Discussion
----------
[Console] Check for existence of proc_open to fix#4338
It is quite common to disable proc_open for security purposes.
This PR checks for the existence of the proc_open function and fixes Issue #4338
Replacement for PR4356
---------------------------------------------------------------------------
by travisbot at 2012-05-21T10:49:59Z
This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1387784) (merged dd991bea into 1407f112).
---------------------------------------------------------------------------
by travisbot at 2012-05-21T11:35:21Z
This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1387991) (merged 0a3dd0fe into 1407f112).
---------------------------------------------------------------------------
by fabpot at 2012-05-21T12:17:32Z
I forgot to ask you to sent a new PR for the 2.0 branch instead of master. Thanks.
---------------------------------------------------------------------------
by davidwindell at 2012-05-21T13:03:36Z
proc_open is not used in 2.0?
Commits
-------
0581c3a Added missing dependency to doctrine common in the global composer.json
cdfb0b1 Changed composer constraint to allow Doctrine 2.3 too
Discussion
----------
Changed composer constraint to allow Doctrine 2.3 too
This allows both the 2.2.x and 2.3.x series for the Doctrine constraints instead of restricting to 2.2.x (thus allowing me to allow Doctrine 2.3 in DoctrineBundle too).
It also fixes some constraint that were missed when bumping the requirement to Doctrine 2.2 and added the missing deps in the global file (FrameworkBundle declares its dependency to ``doctrine/common`` for the ``annotation_reader`` service but it was not declared in the global file)
---------------------------------------------------------------------------
by travisbot at 2012-05-20T20:36:06Z
This pull request [fails](http://travis-ci.org/symfony/symfony/builds/1383231) (merged 0581c3a5 into 1407f112).
---------------------------------------------------------------------------
by stof at 2012-05-20T20:56:18Z
The failure is because the doctrine ORM does not allow Doctrine Common 2.2.x but only stable releases (see doctrine/doctrine2#351 fixing it) and Composer seems to resolve dev dependencies by considering all previous resolved deps as fixed whereas downgrading common to 2.2.2 could have worked to satisfy all deps
---------------------------------------------------------------------------
by fabpot at 2012-05-21T05:56:56Z
So, I cannot merge this until the composer bug is fixed (ping @naderman)
---------------------------------------------------------------------------
by stof at 2012-05-21T07:00:29Z
you could merge it now. The PR to the ORM has been merged so the composer.json is not triggering the issue anymore