Commit Graph

9868 Commits

Author SHA1 Message Date
Jérémie Augustin 09e5f4629d fix markdown for code 2012-05-25 15:14:30 +03:00
Fabien Potencier 023dbf809a merged branch bschussek/issue3879 (PR #4387)
Commits
-------

bc15e2d [Form] Some code cleanup
94f6f77 Restructured Form section of UPGRADE
3d800af [Form] Remove usages of deprecated features
ee803cd [Form] Renamed setVars() to addVars() in FormViewInterface
1c4f632 [Form] Fixed API docs and usage of FormBuilderInterface instead of FormBuilder
2e6cdd1 [Form] Inverted the logic of "single_control" and renamed it to "compound". The opposite is now "simple".
98a7c0c [Form] Consolidated FormInterface, FormBuilderInterface and FormViewInterface
8e128fc [Form][OptionsResolver] Fixed typos
877d8f7 [Form] Reversed the order of $type and $name in FormFactory::createNamed[Builder]()
33fecca [Form] Merged various form events and added class FormEvent
bec8015 [Form] Renamed client and application format to view and model format
8cae328 [Form] setDefaultOptions() is now coded against OptionsResolverInterface
1ecddbc [OptionsResolver] Renamed recommended method to setDefaultOptions()
dc2fa9d [OptionsResolver] Added OptionsResolverInterface
2cd99e8 [Form] Added FormBuilderInterface and FormViewInterface and cleaned up FormTypeInterface and FormTypeExtensionInterface
0ef4066 [Form] Options are now passed to buildView() and buildViewBottomUp()
027259e [Form] Changed getDefaultOptions() to setDefaultOptions(OptionsResolver $resolver) in FormTypeInterface
b4e8bcf [OptionsResolver] Relaxed tests to check that allowed values can also be passed as scalars
97de004 [OptionsResolver] Added option type validation capabilities
0af5f06 [OptionsResolver] Added method setFilters() for augmenting the final option values

Discussion
----------

[Form] Cleaned up the Form API

Bug fix: no
Feature addition: no
Backwards compatibility break: **YES**
Symfony2 tests pass: yes
Fixes the following tickets: #3855, #3879, #4342, #4371, #4375
Todo: -

This PR cleans up the Form API as described in the referenced tickets in order to stabilize and freeze this API in the future. BC is kept wherever possible. After this PR, form types are expected to follow the following interface:

```php
<?php

class MyType extends AbstractType
{
	public function buildForm(FormBuilderInterface $builder, array $options)
	{
	}

	public function buildView(FormViewInterface $view, FormInterface $form, array $options)
	{
	}

	public function finishView(FormViewInterface $view, FormInterface $form, array $options)
	{
	}

	public function setDefaultOptions(OptionsResolverInterface $resolver)
	{
	}

	public function getParent()
	{
	    return 'form';
	}

	public function getName()
	{
	    return 'my_type';
	}
}
```

Note that the options are now passed to `buildView` and `finishView` (formerly `buildViewBottomUp`) as well, reducing the need for creating form attributes in most cases.

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

by travisbot at 2012-05-23T19:07:44Z

This pull request [fails](http://travis-ci.org/symfony/symfony/builds/1414486) (merged 277f5f78 into e0238071).

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

by bschussek at 2012-05-23T19:51:40Z

The PR now also contains the fix for #4342.

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

by travisbot at 2012-05-23T19:51:55Z

This pull request [fails](http://travis-ci.org/symfony/symfony/builds/1414932) (merged 13d284ba into e0238071).

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

by travisbot at 2012-05-24T06:55:35Z

This pull request [fails](http://travis-ci.org/symfony/symfony/builds/1419776) (merged 5aba0778 into e0238071).

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

by travisbot at 2012-05-24T06:56:28Z

This pull request [fails](http://travis-ci.org/symfony/symfony/builds/1419783) (merged 00c4f7ee into b07fb3c4).

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

by travisbot at 2012-05-24T12:26:25Z

This pull request [fails](http://travis-ci.org/symfony/symfony/builds/1421748) (merged 73cd9f8e into b07fb3c4).

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

by bschussek at 2012-05-24T12:27:32Z

The FormView changes described in #4371 are now contained as well. Invitation for final review.

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

by travisbot at 2012-05-24T14:03:10Z

This pull request [fails](http://travis-ci.org/symfony/symfony/builds/1422116) (merged e1f502b9 into b07fb3c4).

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

by cordoval at 2012-05-25T03:26:05Z

any ETA @bschussek ? I want to use it for tackling the problem of dynamic selects city-state
here http://www.craftitonline.com/2011/08/symfony2-ajax-form-republish/

I am told:
"getDefaultOptions is changed to setDefaultOptions which will allow you to set depenedent values based on other forms"

so I am most interested +300!

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

by bschussek at 2012-05-25T06:08:53Z

@cordoval I think you misunderstood this. The OptionsResolver allows you to set options dependent on other options, but of the same field. Also, this is already possible before this merge by setting an option to a closure as described in the README of the OptionsResolver component.

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

by travisbot at 2012-05-25T06:35:53Z

This pull request [fails](http://travis-ci.org/symfony/symfony/builds/1430534) (merged b61cc555 into b07fb3c4).

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

by vicb at 2012-05-25T06:42:24Z

@bschussek great changes ! I have just sent you a PR with some modifs related to deprecated features. I'll rebase and submit the other one we have already discussed.

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

by travisbot at 2012-05-25T07:16:18Z

This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1430699) (merged e18830da into b07fb3c4).

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

by cordoval at 2012-05-25T07:19:07Z

@bschussek what is already possilble @ "Also, this is already possible before"

I am confused could you link to what you are referring to please?

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

by travisbot at 2012-05-25T07:22:07Z

This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1430727) (merged 20c02a72 into b07fb3c4).

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

by bschussek at 2012-05-25T07:22:29Z

```
public function getDefaultOptions()
{
    return array(
        'a' => 'foo',
        'b' => function (Options $options) {
            return 'bar' === $options['a'] ? 'x' : 'y';
        }
    );
}

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

by travisbot at 2012-05-25T10:38:04Z

This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1431903) (merged bc15e2d6 into 45849ce3).
2012-05-25 12:39:27 +02:00
Victor Berchet bc15e2d68b [Form] Some code cleanup 2012-05-25 12:34:17 +02:00
Bernhard Schussek 94f6f7776a Restructured Form section of UPGRADE 2012-05-25 12:34:17 +02:00
Victor Berchet 3d800afec3 [Form] Remove usages of deprecated features 2012-05-25 12:34:16 +02:00
Bernhard Schussek ee803cd948 [Form] Renamed setVars() to addVars() in FormViewInterface 2012-05-25 12:34:16 +02:00
Bernhard Schussek 1c4f632f60 [Form] Fixed API docs and usage of FormBuilderInterface instead of FormBuilder 2012-05-25 12:34:16 +02:00
Bernhard Schussek 2e6cdd15c5 [Form] Inverted the logic of "single_control" and renamed it to "compound". The opposite is now "simple". 2012-05-25 12:34:16 +02:00
Bernhard Schussek 98a7c0cf5f [Form] Consolidated FormInterface, FormBuilderInterface and FormViewInterface 2012-05-25 12:34:16 +02:00
Bernhard Schussek 8e128fc644 [Form][OptionsResolver] Fixed typos 2012-05-25 12:34:16 +02:00
Bernhard Schussek 877d8f7195 [Form] Reversed the order of $type and $name in FormFactory::createNamed[Builder]() 2012-05-25 12:34:16 +02:00
Bernhard Schussek 33fecca210 [Form] Merged various form events and added class FormEvent 2012-05-25 12:34:16 +02:00
Bernhard Schussek bec80157f9 [Form] Renamed client and application format to view and model format 2012-05-25 12:34:16 +02:00
Bernhard Schussek 8cae3282d8 [Form] setDefaultOptions() is now coded against OptionsResolverInterface 2012-05-25 12:34:16 +02:00
Bernhard Schussek 1ecddbc545 [OptionsResolver] Renamed recommended method to setDefaultOptions() 2012-05-25 12:34:15 +02:00
Bernhard Schussek dc2fa9dc69 [OptionsResolver] Added OptionsResolverInterface 2012-05-25 12:34:15 +02:00
Bernhard Schussek 2cd99e80b6 [Form] Added FormBuilderInterface and FormViewInterface and cleaned up FormTypeInterface and FormTypeExtensionInterface 2012-05-25 12:28:17 +02:00
Bernhard Schussek 0ef4066983 [Form] Options are now passed to buildView() and buildViewBottomUp() 2012-05-25 12:28:17 +02:00
Bernhard Schussek 027259eba4 [Form] Changed getDefaultOptions() to setDefaultOptions(OptionsResolver $resolver) in FormTypeInterface 2012-05-25 12:28:17 +02:00
Bernhard Schussek b4e8bcfc5a [OptionsResolver] Relaxed tests to check that allowed values can also be passed as scalars 2012-05-25 12:28:17 +02:00
Bernhard Schussek 97de0041a1 [OptionsResolver] Added option type validation capabilities 2012-05-25 12:28:17 +02:00
Bernhard Schussek 0af5f06703 [OptionsResolver] Added method setFilters() for augmenting the final option values 2012-05-25 12:28:17 +02:00
Fabien Potencier 45849ce306 merged branch Tobion/optionsresolver-optim (PR #4388)
Commits
-------

bad4a1f [OptionsResolver] CS fix in LazyOption
a54ea1b [OptionsResolver] small optimization in Options class
104dcf2 [OptionsResolver] fixed bugs concerning required options
1bfcff4 [OptionsResolver] added failing test cases to demonstrate two bugs
37a3a29 [OptionsResolver] optimized validation

Discussion
----------

[OptionsResolver] fixed two bugs and applied optimization

The first commit optimizes the validation in OptionsResolver by removing several unneeded method calls (without changing anything semantically).

Then I recognized two bugs in the current code that I wrote failing test cases for in the second commit.
1. setAllowedValues wrongly validated missing options
2. required options with defaults were considered missing by `resolve` (contrary to the `isRequired` method)

The third commit fixes these bugs.

The forth commit applies a small optimization in Options and uses a static function call for a static function.

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

by travisbot at 2012-05-24T03:39:34Z

This pull request [fails](http://travis-ci.org/symfony/symfony/builds/1418785) (merged a54ea1b6 into b07fb3c4).

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

by travisbot at 2012-05-24T05:22:33Z

This pull request [fails](http://travis-ci.org/symfony/symfony/builds/1419232) (merged bad4a1f7 into b07fb3c4).

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

by bschussek at 2012-05-24T06:20:02Z

I just tested this on my machine, and static calls are a tiny bit faster here, although this is really irrelevant for practical use. Even though I dislike useless micro-optimizations like this, I'm ok with this PR in general.

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

by Tobion at 2012-05-24T13:23:11Z

I didn't say that's an optimization in the first place. (The optimization was the removal of a variable assignment)
I just changed it because in other PRs I've been told, static functions should be called in a static way.

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

by Tobion at 2012-05-24T23:36:13Z

Please merge before 4387
2012-05-25 09:54:05 +02:00
Fabien Potencier 48ccdaa31b merged branch Seldaek/process-win-fix (PR #4400)
Commits
-------

bcf8cf9 [Process] Refactor the windows handling so it is always executed
0c5aa8b [Process] Add failing test for callbacks on windows

Discussion
----------

[Process] Windows callback handling fix

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

by travisbot at 2012-05-24T18:10:56Z

This pull request [fails](http://travis-ci.org/symfony/symfony/builds/1424957) (merged bcf8cf91 into e2c36c54).
2012-05-25 09:28:10 +02:00
Fabien Potencier 2c50c2d971 merged branch Seldaek/travisfix (PR #4401)
Commits
-------

f2d1695 Force root package version in travis builds

Discussion
----------

Force root package version in travis builds

This hopefully fixes the composer builds. Let's see what travisbot thinks.

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

by travisbot at 2012-05-24T18:45:45Z

This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1425314) (merged f2d16950 into e2c36c54).

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

by Seldaek at 2012-05-24T18:47:09Z

Thank you, @travisbot.

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

by beberlei at 2012-05-24T19:02:33Z

Whats that flag for?

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

by Seldaek at 2012-05-24T19:11:05Z

It just says that the current version of the root package is dev-master, because otherwise since the composer.json file has no version, we can't know, so it tries to guess from git info if it finds any, but in the case of a pull request, the version is not dev-master, so the branch-alias doesn't trigger, so it ends up having a version of symfony/symfony installed that's 1.0.0 - but some of the dependencies require another version, so it sort of conflicts with itself.
2012-05-25 09:11:23 +02:00
Jordi Boggiano f2d169508d Force root package version in travis builds 2012-05-24 20:40:53 +02:00
Jordi Boggiano bcf8cf9116 [Process] Refactor the windows handling so it is always executed
When regular pipes are closed, the file handlers fallback on windows
should still be processed until they are empty
2012-05-24 19:53:48 +02:00
Jordi Boggiano 0c5aa8bf7e [Process] Add failing test for callbacks on windows 2012-05-24 19:52:29 +02:00
Fabien Potencier e2c36c544d merged branch craue/patch-22 (PR #4395)
Commits
-------

d11af63 avoid showing the web profiler toolbar loading error if status is 0

Discussion
----------

[WebProfilerBundle] avoid showing the web profiler toolbar loading error if status is 0

Currently, such error is also shown if loading the page is manually aborted, e.g. by clicking on a link before the toolbar has been loaded, which is quite annoying.

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

by travisbot at 2012-05-24T14:42:43Z

This pull request [fails](http://travis-ci.org/symfony/symfony/builds/1422610) (merged d11af636 into b07fb3c4).
2012-05-24 16:46:49 +02:00
Christian Raue d11af63672 avoid showing the web profiler toolbar loading error if status is 0 2012-05-24 16:06:17 +02:00
Tobias Schultze bad4a1f76c [OptionsResolver] CS fix in LazyOption 2012-05-24 07:20:57 +02:00
Tobias Schultze a54ea1b6b2 [OptionsResolver] small optimization in Options class 2012-05-24 05:32:58 +02:00
Tobias Schultze 104dcf251d [OptionsResolver] fixed bugs concerning required options 2012-05-24 05:31:42 +02:00
Tobias Schultze 1bfcff4fab [OptionsResolver] added failing test cases to demonstrate two bugs 2012-05-24 05:29:35 +02:00
Tobias Schultze 37a3a29c59 [OptionsResolver] optimized validation 2012-05-24 02:48:57 +02:00
Fabien Potencier b07fb3c459 merged branch bschussek/issue4385 (PR #4386)
Commits
-------

bad6d04 [Form] Added accessor FormConfigInterface::getByReference() and let Form clone objects if not by reference
fc23701 [Form] Correctly highlighted BC breaks in the CHANGELOG
d1864c7 [Form] Fixed: Virtual forms are ignored when prepopulating a form

Discussion
----------

[Form] Fixed: PropertyPathMapper did not always ignore virtual forms

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

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

by travisbot at 2012-05-23T12:13:49Z

This pull request [fails](http://travis-ci.org/symfony/symfony/builds/1410299) (merged a7f90944 into e0238071).

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

by travisbot at 2012-05-23T12:27:30Z

This pull request [fails](http://travis-ci.org/symfony/symfony/builds/1410430) (merged 52510fee into e0238071).

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

by travisbot at 2012-05-23T12:37:00Z

This pull request [fails](http://travis-ci.org/symfony/symfony/builds/1410485) (merged ca5aee9c into e0238071).

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

by travisbot at 2012-05-23T13:01:10Z

This pull request [fails](http://travis-ci.org/symfony/symfony/builds/1410669) (merged bad6d040 into e0238071).
2012-05-23 21:13:17 +02:00
Bernhard Schussek bad6d040d7 [Form] Added accessor FormConfigInterface::getByReference() and let Form clone objects if not by reference 2012-05-23 14:51:26 +02:00
Bernhard Schussek fc2370104f [Form] Correctly highlighted BC breaks in the CHANGELOG 2012-05-23 14:46:49 +02:00
Bernhard Schussek d1864c7d63 [Form] Fixed: Virtual forms are ignored when prepopulating a form 2012-05-23 14:46:45 +02:00
Fabien Potencier e0238071d4 merged branch bschussek/dataclassfix (PR #4374)
Commits
-------

82c221a [Form] Fixed strict "data_class" check to work with instances of \ArrayAccess

Discussion
----------

[Form] Fixed collection type to work with recent Form changes

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

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

by tristanbes at 2012-05-22T16:42:36Z

Ping @fabpot Could you please merge it ASAP, because this bugs breaks all forms containing collection type.

Thanks

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

by travisbot at 2012-05-22T16:54:24Z

This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1401580) (merged 82c221a1 into 1a1403f5).
2012-05-22 19:03:35 +02:00
Bernhard Schussek 82c221a1dd [Form] Fixed strict "data_class" check to work with instances of \ArrayAccess 2012-05-22 18:24:59 +02:00
Fabien Potencier 1a1403f599 merged branch asm89/numeric-keys-config (PR #4276)
Commits
-------

b7fc009 [Config] Numerical keys for prot. arrays if useAttributeAsKey is set

Discussion
----------

[Config] Numerical keys for prot. arrays if useAttributeAsKey is set

Bug fix: not sure
Feature addition: not sure
Backwards compatibility break: not sure
Symfony2 tests pass: [![Build Status](https://secure.travis-ci.org/asm89/symfony.png?branch=numeric-keys-config)](http://travis-ci.org/asm89/symfony)
License of the code: MIT

When using an array node with children of prototype array and `useAttributeAsKey`, using numerical values for the keys throws an exception. For example (`useAttributeAsKey('id')`):

``` php
<?php
// works
array (
    'thing' => array(
        array('foo', 'bar', 'id' => 'a')
    )
);

// works and is the same as above
array (
    'thing' => array(
        'a' => array('foo', 'bar')
    )
);

// works
array(
    'thing' => array(
        array('foo', 'bar', 'id' => 42), array('baz', 'qux', 'id' => 1337),
    ),
);

// works with this patch and is the same as above
array(
    'thing' => array(
        42 => array('foo', 'bar'), 1337 => array('baz', 'qux'),
    ),
);
```

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

by travisbot at 2012-05-14T14:26:32Z

This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1327383) (merged 42d252da into 46ffbd52).

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

by travisbot at 2012-05-14T14:32:59Z

This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1327430) (merged b7fc0093 into 46ffbd52).

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

by vicb at 2012-05-21T15:16:24Z

Could this be fixed by changing [PrototypedArrayNode](https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Config/Definition/PrototypedArrayNode.php#L255)
`$k = $v[$this->keyAttribute];` -> `$k = (string) $v[$this->keyAttribute];`

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

by asm89 at 2012-05-22T07:01:53Z

I tried it and the test I added still fails. The code change you propose doesn't execute because `if (!isset($v[$this->keyAttribute]) && is_int($k))` will still evaluate to true.
2012-05-22 18:02:05 +02:00
Fabien Potencier ad6779bc2f merged branch grEvenX/authorization_example_fix (PR #4370)
Commits
-------

0935964 Modified example for mod_rewrite to not add Authorization header if it is not set in the request

Discussion
----------

Correct example mod_rewrite to not add Authorization header that does not exists

The in-line PHP code comment suggest to do some changes in .htaccess with mod_rewrite to pass HTTP-Authorization header to PHP. This leads to the Authorization header being introduced even when it's not originally in the request (albit empty, the result of ParameterBag->has('Authorization') will return true when you expect it not to.
Some external libraries might check for this header and perform logic based on wether it was set or not (The php-oauth2 library in my case).

I suggest this fix which I think is a more proper way of handling the case anyway, since when the header is not set you don't expect it to exist in the ServerBag either.

(I tried to search the documentation for this but did not find it, but I guess this probably should go into the documentation somewhere?)

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

by travisbot at 2012-05-22T12:51:25Z

This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1399753) (merged 0935964b into 517ae43f).
2012-05-22 15:10:48 +02:00
Fabien Potencier 3b58564ed0 merged branch kevindew/form_view_errors (PR #4224)
Commits
-------

e92212a [Form] Added valid attribute to a FormView

Discussion
----------

[Form] Added "valid" to view parameters

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

This PR adds a parameter of contains_errors to a FormView when buildView is called.

The use case for this addition is when you want to show that a form or sub forms has errors (e.g. when rendering a long form a header message of "This form contains errors" or adding a class to a whole sub form to show an erroneous state) is currently very difficult/near impossible and may need the original form object being accessible in the view layer.

Whats a bit grey here is the best phrasing to use for this. Options I weighed up were is_valid (seemed a bit semantically incorrect in a template, since it would return true pre bind) and has_errors_deep (which i wasn't sure if it fitted naming conventions).

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

by travisbot at 2012-05-07T20:25:55Z

This pull request [fails](http://travis-ci.org/symfony/symfony/builds/1269345) (merged fe1f5aee into 919604ab).

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

by henrikbjorn at 2012-05-19T18:36:33Z

couldnt you just use `{% if errors %}` in your views?

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

by stof at 2012-05-19T19:17:20Z

@henrikbjorn ``errors`` contains only the errors attached to the form itself. It will not tell you when there is some errors in a child form.

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

by kevindew at 2012-05-22T10:43:45Z

Sure, done

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

by travisbot at 2012-05-22T10:45:12Z

This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1399006) (merged 9f6658d4 into 517ae43f).

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

by kevindew at 2012-05-22T10:57:54Z

Shoot, sorry about that.

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

by travisbot at 2012-05-22T11:00:00Z

This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1399096) (merged 88920591 into 517ae43f).

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

by bschussek at 2012-05-22T11:17:38Z

Can you squash the commits and prefix the message with "[Form]" please?

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

by travisbot at 2012-05-22T11:49:52Z

This pull request [fails](http://travis-ci.org/symfony/symfony/builds/1399390) (merged ca771822 into 517ae43f).

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

by kevindew at 2012-05-22T11:53:18Z

Sure, done (I've sorted the travis fail btw)

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

by travisbot at 2012-05-22T11:55:10Z

This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1399404) (merged e92212ac into 517ae43f).

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

by bschussek at 2012-05-22T12:25:45Z

@fabpot 👍
2012-05-22 15:08:07 +02:00
Even André Fiskvik 0935964b29 Modified example for mod_rewrite to not add Authorization header if it is not set in the request 2012-05-22 14:38:37 +02:00
Kevin Dew e92212ac13 [Form] Added valid attribute to a FormView 2012-05-22 12:51:19 +01:00
Fabien Potencier 517ae43fe9 [Console] added an exception when an option name or shortcut is invalid (refs #4346) 2012-05-22 12:35:53 +02:00
Fabien Potencier c1e868f994 merged branch Nanocom/master (PR #4346)
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).
2012-05-22 12:30:31 +02:00
Fabien Potencier a6b3902128 added the possibility to translate the placeholder and title attributes in the PHP form templates (refs #4194) 2012-05-22 12:23:06 +02:00
Fabien Potencier 5ca64b42fa merged branch andrefgneves/translate-widget-attributes (PR #4194)
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.
2012-05-22 12:16:26 +02:00