Commits
-------
c4e68a3 [Form] Moved logic of addXxx()/removeXxx() methods to the PropertyPath class
Discussion
----------
[Form] Moved logic of addXxx()/removeXxx() methods to the PropertyPath class
Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: #3732
Todo: -
![Travis Build Status](https://secure.travis-ci.org/bschussek/symfony.png?branch=issue3732)
The addXxx()/removeXxx() methods should now be called correctly in ChoiceType and CollectionType.
PropertyPath now favors addXxx()/removeXxx() over setXxx() for collections. For example:
```
$propertyPath = new PropertyPath('article.tags');
// Tries to use addTag()/removeTag() and only uses setTags() (et al.)
// if not found
$propertyPath->setValue($article, $tags);
```
For other languages than English or very irregular plurals, a custom singular can be set by separating it with a pipe:
```
$propertyPath = new PropertyPath('article.genera|genus');
```
---------------------------------------------------------------------------
by bschussek at 2012-04-07T12:40:39Z
Again, the failing build is not my fault.
Commits
-------
61d792e [Form] Changed checkboxes in an expanded multiple-choice field to not include the choice index
bc9bc4a [Form] Fixed behavior of expanded multiple-choice field when submitted without ticks
2e07256 [Form] Simplified choice list API
2645120 [Form] Fixed handling of expanded choice lists, checkboxes and radio buttons with empty values ("")
Discussion
----------
[Form] Fixed handling of empty values in checkbox/radio/choice type
Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: #3839, #3366
Todo: -
![Travis Build Status](https://secure.travis-ci.org/bschussek/symfony.png?branch=issue3839)
This PR fixes the processing of checkboxes and radio buttons with empty "value" attributes as well as of expanded choice forms with empty values. Additionally, some unnecessary complexity has been removed of the new ChoiceList API.
---------------------------------------------------------------------------
by stof at 2012-04-10T13:56:12Z
You probably need to change some things in the CHANGELOG file too
---------------------------------------------------------------------------
by bschussek at 2012-04-10T14:39:24Z
No. This is an update of a previous post-2.0 PR, the CHANGELOG is still accurate.
---------------------------------------------------------------------------
by stof at 2012-04-10T14:46:47Z
well, doesn't it require changes to the description of previous changes related to the ChoiceList ? It does in the UPGRADE file so it is weird if the CHANGELOG does not require any change.
---------------------------------------------------------------------------
by bschussek at 2012-04-10T14:56:05Z
Feel free to check yourself :)
Commits
-------
004c873 [Form] Fixed display of DateTimeType and TimeType when displayed as "single_text" and "with_seconds" is false
Discussion
----------
[Form] Fixed display of [Date]TimeType when displayed as "single_text" and "with_seconds" is false
Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: #3278
Todo: -
![Travis Build Status](https://secure.travis-ci.org/bschussek/symfony.png?branch=issue3278)
Commits
-------
a56bea6 removed `param_converter` from symfony-1.0.xsd
Discussion
----------
removed `param_converter` from symfony-1.0.xsd
I think its a relict of the SensioFrameworkExtraBundle?
Commits
-------
55014a6 [Routing] Request methods always return a raw path, fix the matcher to decode only once
d17ba0e Fixed base URL detection when request URI contains encoded chars
Discussion
----------
[RFC] Fix issues with url decoding
Related: #2324, #2963, #2962, #2579
### This PR fixes two issues:
* `+` in paths were turned to " " by `urldecode()`
* `urldecode()` was called a few times (and a different number of times according to which part of the path was handled, see #2962 for details).
### BC Breaks:
* `Request::getPathInfo()`, `Request::getBaseUrl()` and `Request::getBasePath` now return the raw (encoded) path (vs a decoded path before this PR). You should check any calls to these methods in your code and wrap them in `rawurldecode()` if needed.
* The `UrlMatcher` now decodes the URL only once (i.e. variable are no more decoded twice) and use `rawurldecode()` to support `+`.
### Notes:
* @arnaud-lb, the first commit is based on your #2963 so I put your name for the commit,
### Comment history from the original PR:
@vicb
**The state before this PR:**
* getRequestUri() returns an **encoded** value
* getPathInfo() returns a **decoded** value
* getBaseUrl() returns a **decoded** value
* getBasePath() returns a **decoded** value
The decoded value is wrong as `urldecode` is used in place of `rawurldecode` turning `+` into a space character (#2324).
The matcher starts by urldecoing the path (it is already decoded as explained right before) and then urldecodes each variable one more time.
We end up with a path being decoded twice and variables being decoded three times.
`Request::getUri()` calls both `getBaseUrl()` and `getPathInfo()` so that the return URI is **decoded**.
**The state after the PR:**
* getRequestUri() returns an **encoded** value
* getPathInfo() returns an **encoded** value
* getBaseUrl() returns an **encoded** value
* getBasePath() returns an **encoded** value
We are consistent and we have the raw values everywhere - there is no (easy) way to get the encoded value back once it has been decoded as it is done in the current code.
The matcher relies on an encoded value and decode the value only once (using `rawurldecode` to support `+`s).
So basically this PR:
* fix a bug - URL with `+` are now supported,
* makes paths consistent - encoded values everywhere, including `getUri()`
* makes variables consistent: they are decoded only once - the same as query string parameters.
There are some BC breaks:
* getPathInfo() returns an encoded value vs a decoded one before,
* getBaseUrl() returns an encoded value vs a decoded one before.
* getBasePath() returns an encoded value vs a decoded one before.
Any code relying on the output of one of the 2 previous methods should be checked and upgraded if needed. I am interested in the use cases where your code need to be updated.
@Seldaek
I checked a few projects and this is what I found (usage of getPathInfo & getBaseUrl):
- One use case of getPathInfo to check if the url started with `/something/` which is a prefix used for all "overlay" content which had to be treated differently somewhere => most likely unaffected
- One use case for checking path prefixes by regex in our [CorsBundle](https://github.com/nelmio/NelmioCorsBundle/blob/master/EventListener/CorsListener.php#L52-56) => potentially affected depending on the complexity of regexes I'd say
@vicb
Thanks @Seldaek for reporting the use cases. You second case would be solved by `rawurldecode`ing the path info which is a minimal change.
And in general I think we have to expand to doc to specify the url format that should be used.
---------------------------------------------------------------------------
by vicb at 2012-04-04T13:42:21Z
I'll squash the commits before this gets merged but for now it make the review easier.
Commits
-------
78d6f3f [Filesystem] Written missing tests.
1998f3f [Filesystem] Added silence operator to rename().
7ce5a52 [Filesystem] Fixed docs for rename().
3f2865b [Filesystem] rename() throws RuntimeException on error (fixes#3848).
Discussion
----------
[Filesystem] rename() throws RuntimeException on error.
Bug fix: no
Feature addition: yes
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: #3848
---------------------------------------------------------------------------
by alessandro1997 at 2012-04-09T19:32:23Z
I have a doubt: I can't write any tests since the rename() function generates a warning if an error occurs. Should I use the silence operator or what else?
Maybe @stof could enlighten me?
Commits
-------
6dca141 [Process] Skip signal assertion on windows
4cd0fb4 [Process] Skip test that is still getting stuck on windows
e82a05d [Process] Close pipes before calling proc_close to avoid deadlocks as advised on the proc_close php.net documentation
f4227b5 [Process] Removing useless code (this is already done in updateStatus)
2d586d2 [Process] Fix a mistake triggering stream_select errors
Discussion
----------
Process fixes
A few fixes, including making the tests pass on windows and fixing composer/composer#543. Given the sensitivity of this code I did a bunch of very granular commits explaining everything.
Commits
-------
8726ade Adds more features to twig:lint command
1d7e9d9 Adds a linter command for templates
Discussion
----------
Adds a linter command for templates
Let's this PR be stoffed. ;)
---------------------------------------------------------------------------
by Tobion at 2012-04-06T15:48:18Z
Checking a single file is very limited. Checking a whole directory would be more useful, wouldn't it?
---------------------------------------------------------------------------
by willdurand at 2012-04-06T17:56:57Z
I think you should provide a way to validate all templates for a given bundle, something like:
php app/console twig:lint @MySuperBundle
---------------------------------------------------------------------------
by henrikbjorn at 2012-04-06T18:03:45Z
Wouldnt it be better to throw some kind of exception if the lint is erroneous?
---------------------------------------------------------------------------
by marcw at 2012-04-07T11:22:34Z
@Tobion @willdurand You can do that by combining unix tools.
@henrikbjorn Why ?
---------------------------------------------------------------------------
by marcw at 2012-04-07T11:27:11Z
Updated.
---------------------------------------------------------------------------
by dlsniper at 2012-04-07T13:15:53Z
@marcw it would be indeed nice to have support for a bundle/directory out of the box as some of the Symfony2 users might not be running unix or know the right commands to make this work.
I could help you with a PR in your repo if you want.
---------------------------------------------------------------------------
by henrikbjorn at 2012-04-07T18:55:34Z
@marcw as the console component will catch them and convert them into the right error code, also will display what went wrong instead of just dieing.
---------------------------------------------------------------------------
by marcw at 2012-04-08T09:15:37Z
Updated with all comments and requested features.
Setting a property path like "article.tags" will now automatically try to
favor addTag() and removeTag() over setTags(), if found. If you want to
set up a property path with an irregular singular that is not detected,
you can use "|" to separate the plural from the singular form in the
path: "article.genera|genus".
Another consequence of this commit is that the MergeCollectionListener has
been simplified a lot. Forms returning an array or a collection will
always result in adders/removers being called now without having to add
this listener.
Commits
-------
fad114b Tweaked the exceptions layout CSS in order to display the error message even when wrapped around <pre> tags
Discussion
----------
Tweaked the exceptions layout CSS in order to display the error message even when wrapped around <pre> tags
Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: ![Build status](https://secure.travis-ci.org/ruimarinho/symfony.png?branch=exception_css_tweaks)
Fixes the following tickets: -
Todo: -
Ever been in a situation when you're debugging code wrapped around `<pre>` tags and that code throws an exception? If you're familiar with this screenshot, you have :-) ![Image](http://i.imgur.com/dwxdD.png)
This PR is just a little tweak to the exceptions layout CSS in order to allow your to view the exception message. It also fixes a word break when messages are too long. ![Image 2](http://i.imgur.com/whxZv.png).
The build is currently failing due to an unmerged patch from the 2.0 branch.
Commits
-------
fdee352 [TwigBridge] updated suggested packages
dad1750 [TwigBridge] updated TestCase as an abstract class
140ac20 [TwigBridge] fixed bootstrap
Discussion
----------
[TwigBridge] updated Composer suggested packages and test fixes
---------------------------------------------------------------------------
by eriksencosta at 2012-04-08T06:13:53Z
Rebased.
Commits
-------
22e2ad8 [Filesystem] Fixed relative path calculation for end path which is a subdirectory of the start path.
bc93787 [Filesystem] Fixed relative path calculation for paths with various combinations of trailing directory separators.
Discussion
----------
[Filesystem] Fixed relative path calculation
Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Commits
-------
7f92833 [BrowserKit] Fixed cs.
df3da28 [BrowserKit] Using assertNull instead of assertEquals.
87890d3 [BrowserKit] Fixed CookieJar issue being unable to parse multiple cookies from Set-Cookie.
Discussion
----------
[BrowserKit] Fixed CookieJar being unable to parse multiple cookies
Fix proposition for #3109
My fix splits value of *Set-Cookie* header by comma. Than it checks each extracted part if it starts with a cookie-name (token). If check is positive cookie is added to the list. Otherwise it's appended to the previous value. First element is always added to the list.
[rfc6265](http://tools.ietf.org/html/rfc6265) defines cookie-name with token:
cookie-name = token
token = <token, defined in [RFC2616], Section 2.2>
token is defined in [rfc2616](http://tools.ietf.org/html/rfc2616#section-2.2) as follows:
token = 1*<any CHAR except CTLs or separators>
CHAR = <any US-ASCII character (octets 0 - 127)>
separators = "(" | ")" | "<" | ">" | "@"
| "," | ";" | ":" | "\" | <">
| "/" | "[" | "]" | "?" | "="
| "{" | "}" | SP | HT
That means cookie-name can be built out of following set of characters: *! # $ % & ' * + - . ^ _ ` | ~ 0-9 A-Z a-z*
Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Commits
-------
e0ce6b4 [Form] Fixed required value guessed by ValidatorTypeGuesser
Discussion
----------
[Form] Fixed required value guessed by ValidatorTypeGuesser
Bug fix: yes
Feature addition: no
Backwards compatibility break: no*
Symfony2 tests pass: yes
Fixes the following tickets: #3661
Todo: -
![Travis Build Status](https://secure.travis-ci.org/bschussek/symfony.png?branch=issue3661)
The documentation states that a field is set to required if constrained with NotBlank or NotNull and to not required otherwise. Due to a bug this was not the case and fields were always required. This is now fixed.
The consequence is that some fields that were required before by default are not required anymore. The only difference is that the HTML5 "required" attribute disappears, because server-side validation did not occur before anyway.