Commit Graph

8257 Commits

Author SHA1 Message Date
Gordon Franke 5bf1143f83 fix some translations component phpdocs 2012-01-24 10:12:17 +01:00
Fabien Potencier bcef85b948 merged branch vicb/issue/1579 (PR #3035)
Commits
-------

43e0db5 [DomCrawler] Add support for multivalued form fields (fix #1579, #3012)

Discussion
----------

[DomCrawler] Support for multivalued fields

This is a tentative fix for #1579 by @kriswallsmith, also see #3012 for more info.

Any feedback is appreciated.

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

by vicb at 2012-01-05T08:44:51Z

@stof thanks for the valuable feedback I think most of it should be implemented should we use this solution.
The one thing I don't agree is PSR-0, I don't want this class to be public, that's is just a "private" helper class.

There are also missing type hints in the helper class, that should be added.

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

by alessandro1997 at 2012-01-05T10:05:15Z

Well, @vicb, I think it's up to the developer to not use "private" classes. Just write it in the documentation. But declaring two classes in the same file would be a big violation of the standards.

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

by vicb at 2012-01-05T11:28:53Z

What "standard"s ?
PSR-0 is about auto-loading, I don't want/need this to be autoloaded.
Sf coding standards ? Well relying on a developer reading the doc is more error prone than the current implementation. I sometimes favor pragmatism over theory.

edit: I am not trying to say I am right here but only that I don't see any added value in moving the helper class to a dedicated file. I appreciate any feedback, really.

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

by fabpot at 2012-01-06T11:55:09Z

FYI, we already have such a "private" class in https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Security/Http/Firewall/DigestAuthenticationListener.php#L135

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

by vicb at 2012-01-06T16:36:04Z

@alessandro1997 if you need an example on why it is not safe to rely on developers reading comments, see #2892

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

by vicb at 2012-01-09T22:19:52Z

@fabpot I am waiting for your feedback on the [proposed API](https://github.com/symfony/symfony/pull/3035/files#L1R57) before finishing this PR.

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

by drak at 2012-01-10T05:12:16Z

@fabpot

> FYI, we already have such a "private" class in https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Security/Http/Firewall/DigestAuthenticationListener.php#L135

Why on is that necessary, it could just be another class file in the namespace.  Unless you are making some kind of forward compatibility, e.g. for with a new class in PHP 5.4 then I see no reason to do that.

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

by vicb at 2012-01-10T07:40:32Z

What would be a good reason not to allow "private" classes ?
If the Sf coding standards are the only good reason let's change them then.

[Java](http://stackoverflow.com/questions/968347/can-a-java-file-have-more-than-one-class) and [ActionScript3](http://livedocs.adobe.com/flex/3/html/help.html?content=03_Language_and_Syntax_05.html) allow such construction

I would no say any better than the above link on Stack Overflow:

> The purpose of including multiple classes in one source file is to bundle related support functionality (internal data structures, support classes, etc) together with the main public class. Note that it is always ok not to do this -- the only effect is on the readability (or not) of your code.

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

by Tobion at 2012-01-10T09:35:09Z

There are also many private classes in the test cases.

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

by stof at 2012-01-10T13:29:08Z

@Tobion for tests, it is logical because there is no autoloader for the test classes.

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

by vicb at 2012-01-10T13:31:53Z

@stof by definition you do not want a "private" class to be autoloaded anyway.

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

by alessandro1997 at 2012-01-10T14:11:42Z

Sure, but what you're doing here is just making instantiating the class a bit more difficult. If a stubborn developer wants to use it, then he (or her) can include the file manually or autoload the "main class".

PHP does NOT have support for private/inner classes, and, until it does, all classes should be istantiable normally.

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

by stof at 2012-01-10T14:23:30Z

@vicb what about someone wanting to serialize the object ? (well, serializing is not the issue. unserializing is)

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

by vicb at 2012-01-10T14:57:52Z

@alessandro1997 you are absolutely right, it's not meant to be instantiated from the outside (it's **private**). You could argue the same with private properties & methods (using Reflection). Dead-end.

@stof Is unserializing really an issue as the file would have been loaded already ?

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

by fabpot at 2012-01-22T09:38:13Z

@vicb: I'm fine with the proposed API, but I fail to see why it would be more BC than #3012.

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

by vicb at 2012-01-22T10:06:56Z

For BC I have to check #3012 again but at some point if I remember correctly the public API had changed (not sure about the latest version in your branch)

By introducing the private helper class, it is quite easy to see that the public API is not modified by this PR.

Next steps:

  * Stof the code,
  * Add/fix phpdoc,
  * Add tests for the helper class,
  * Add/refactor tests for the `Form` class.

@fabpot if you agree with the above steps it could be ready sometime next week.

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

by fabpot at 2012-01-22T10:21:16Z

The API is perhaps not changed but the behavior will certainly changed. I agree with your steps.

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

by vicb at 2012-01-22T10:45:10Z

Which leads to the question: should we consider this as a change in behavior (2.1) or a bug fix (2.0) ?

_I am thinking of a form with multiple fields named `field[]`_

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

by fabpot at 2012-01-22T11:32:04Z

@vicb: this change should be done on master

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

by vicb at 2012-01-24T07:59:40Z

Should be ready now, let me know when I should squash after review.

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

by fabpot at 2012-01-24T08:18:03Z

@vicb: yes, can you squash your commits?

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

by vicb at 2012-01-24T08:29:58Z

@fabpot done
2012-01-24 09:35:39 +01:00
Victor Berchet 43e0db5f75 [DomCrawler] Add support for multivalued form fields (fix #1579, #3012) 2012-01-24 09:28:29 +01:00
Fabien Potencier d8541abf71 merged branch lsmith77/form_helper_csrf_off (PR #3174)
Commits
-------

cc31a15 tweaked the exception message
3a1699a handle disaled csrf protection in the Twig FormExtension
2a998e0 handle disabled csrf protection in the PHP templating form helper

Discussion
----------

handle disabled csrf protection in the PHP templating form helper

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: ![Build Status](https://secure.travis-ci.org/lsmith77/symfony.png?branch=form_helper_csrf_off)
Fixes the following tickets: -

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

by fabpot at 2012-01-23T17:00:31Z

The same should be done for Twig, no?

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

by lsmith77 at 2012-01-23T17:04:24Z

hmm i guess so .. will apply the change there too .. once someone tells me how to format that ``instanceof`` check :)

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

by lsmith77 at 2012-01-23T17:07:11Z

updated the ``FormExtension`` too

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

by lsmith77 at 2012-01-23T21:28:52Z

hopefully all ready to go now ..

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

by lsmith77 at 2012-01-24T08:12:38Z

@fabpot: don't want to rush you .. but if this could be merged soon, it would make my life easier :)
2012-01-24 09:19:06 +01:00
Bernhard Schussek 7c7097675b [Form] Fixed text in UPGRADE file 2012-01-24 01:23:01 +01:00
Bernhard Schussek c26b47af8d [Form] Made query parameter name generated by ORMQueryBuilderLoader unique 2012-01-24 01:13:50 +01:00
Bernhard Schussek 18f92cd331 [Form] Fixed double choice fixing 2012-01-24 01:09:35 +01:00
Bernhard Schussek f533ef0e1b [Form] Added ChoiceView class for passing choice-related data to the view 2012-01-24 01:07:33 +01:00
lsmith77 cc31a157d3 tweaked the exception message 2012-01-23 22:02:19 +01:00
Bernhard Schussek d72900e613 [Form] Incorporated changes suggested in PR comments 2012-01-23 18:58:56 +01:00
Bernhard Schussek 28d2f6d38d Removed duplicated lines from UPGRADE file 2012-01-23 18:28:25 +01:00
Bernhard Schussek e1fc5a5c8c [Form] Restricted form names to specific characters to (1) fix generation of HTML IDs and to (2) avoid problems with property paths.
ad (1): HTML4 "id" attributes are limited to strings starting with a letter and containing only letters, digits, underscores, hyphens, periods and colons.

ad (2): Property paths contain three special characters needed for correct parsing: left/right bracket and period.

The rules for form naming are:

* Names may start with a letter, a digit or an underscore. Leading digits or underscores will be stripped from the "id" attributes.
* Names must only contain letters, digits, underscores, hyphens and colons.
* Root forms may have an empty name.

Solves #1919 and #3021 on a wider scope.
2012-01-23 18:28:25 +01:00
Bernhard Schussek 87b16e7015 [Form] Greatly improved ChoiceListInterface and all of its implementations
Fixes #2869, fixes #3021, fixes #1919, fixes #3153.
2012-01-23 18:28:25 +01:00
lsmith77 3a1699a420 handle disaled csrf protection in the Twig FormExtension 2012-01-23 18:05:48 +01:00
lsmith77 2a998e01b9 handle disabled csrf protection in the PHP templating form helper 2012-01-23 17:49:28 +01:00
Fabien Potencier fbbea2f369 merged branch stof/doctrine_collector (PR #3173)
Commits
-------

e37783f [DoctrineBridge] Refactored the query sanitization in the collector
3b260d2 Refactored the collector to separate the loggers per connection

Discussion
----------

Doctrine collector

Bug fix: no
Feature addition: yes
Backwards compatibility break: yes (for the end user, it will require deleting old profiler data)
Symfony2 tests pass: yes ![Build Status](https://secure.travis-ci.org/stof/symfony.png?branch=doctrine_collector)

This refactors the Doctrine collector to allow implementing doctrine/DoctrineBundle#7
The first commit splits the logging of queries per connection to be able to know which connection was used instead of using a shared stack.

The second commit refactors the sanitation of the parameters to apply the DBAL conversion and then keep the param whenever possible (i.e. when we are sure it is serializable). Such queries will then be explainable in the profiler as we will be able to use the parameters again. Due to the way PDO works, the only cases where we would get an unexplainable queries due to the parameters are queries using a LOB parameter (as it is a resource) or broken queries (passing an object to PDO for instance). And this second case does not make sense to explain the query of course.

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

by stof at 2012-01-23T12:32:16Z

Merging this PR should be synchronized with the DoctrineBundle PR due to the BC break in the collector
2012-01-23 13:45:25 +01:00
Christophe Coevoet e37783f4f9 [DoctrineBridge] Refactored the query sanitization in the collector
The original parameters are kept whenever possible to allow using them
again to explain the query.
2012-01-23 10:57:46 +01:00
Fabien Potencier c819d84d69 Revert "[FrameworkBundle] removed the possibility to pass a non-scalar attributes when calling render() to make the call works with or without a reverse proxy (closes #2941)"
This reverts commit 254e49b47c.
2012-01-23 09:41:28 +01:00
Fabien Potencier 9eaaca0651 Revert "[FrameworkBundle] allowed attributes of the render() method to be arrays"
This reverts commit 789d5ad20f.
2012-01-23 09:41:23 +01:00
Christophe Coevoet 3b260d268b Refactored the collector to separate the loggers per connection 2012-01-23 09:22:30 +01:00
Fabien Potencier 4bf9ebc9a0 Revert "updated CHANGELOG for 2.1"
This reverts commit 61ab4dcbf2.
2012-01-22 17:21:38 +01:00
Fabien Potencier 3749355ba7 removed debug code 2012-01-22 17:21:04 +01:00
Fabien Potencier 9d8f386bc6 merged branch 1ed/hungarian-validator-messages (PR #3170)
Commits
-------

0f680c2 [FrameworkBundle] updated hungarian validator messages

Discussion
----------

[FrameworkBundle] updated hungarian validator messages
2012-01-22 16:53:36 +01:00
Fabien Potencier 35a61b3a52 [HttpKernel] added arguments to ExceptionHandler (closes #2739) 2012-01-22 16:53:27 +01:00
Fabien Potencier 63adb97cf2 Revert "merged branch blogsh/dynamic_constraints (PR #3114)"
This reverts commit 6b9a355fb0, reversing
changes made to 811ead8589.
2012-01-22 16:50:02 +01:00
Gábor Egyed 0f680c2cc9 [FrameworkBundle] updated hungarian validator messages 2012-01-22 15:37:28 +01:00
Fabien Potencier 53b3c8304f [HttpKernel] fixed indentation of generated HTML in ExceptionHandler 2012-01-22 11:20:16 +01:00
Fabien Potencier 8d79ebc8ce [HttpKernel] added some unit tests for ExceptionHandler and
FlattenException
2012-01-22 11:19:40 +01:00
Fabien Potencier c290d829a7 merged branch gustavopiltcher/master (PR #2858)
Commits
-------

4a797df Oracle issues
81d73bb Oracle issues
2316b21 Oracle issues
315bfc4 just update
b20b15b Oracle 10 issues

Discussion
----------

Oracle issues

updated with some adjustments required by stof

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

by fabpot at 2011-12-13T07:24:12Z

@schmittjoh: Can you have a look at this PR?

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

by fabpot at 2011-12-24T08:19:37Z

Can you squash your commit before I merge your PR? Thanks.
2012-01-22 10:45:17 +01:00
Fabien Potencier fce2a67f91 updated CHANGELOG for 2.1 2012-01-22 10:45:06 +01:00
Fabien Potencier 8358cbf7a6 merged branch kriswallsmith/csrf-token-helper (PR #3080)
Commits
-------

753c067 [FrameworkBundle] added $view['form']->csrfToken() helper
e1aced8 [Twig] added {{ csrf_token() }} helper

Discussion
----------

[Twig] [FrameworkBundle] added CSRF token helper

I've added a templating helper and Twig function for generating a CSRF token without the overhead of creating a form.

```html+jinja
<form action="{{ path('user_delete', { 'id': user.id }) }}" method="post">
    <input type="hidden" name="_method" value="delete">
    <input type="hidden" name="_token" value="{{ csrf_token('delete_user_' ~ user.id) }}">
    <button type="submit">delete</button>
</form>
```

```php
<?php

class UserController extends Controller
{
    public function delete(User $user, Request $request)
    {
        $csrfProvider = $this->get('form.csrf_provider');
        if (!$csrfProvider->isCsrfTokenValid('delete_user_'.$user->getId(), $request->request->get('_token')) {
            throw new RuntimeException('CSRF attack detected.');
        }

        // etc...
    }
}
```

The test that is failing on Travis appears to be unrelated, but I may be wrong?

```
1) Symfony\Bundle\SecurityBundle\Tests\Functional\LocalizedRoutesAsPathTest::testLoginLogoutProcedure with data set #1 ('de')
RuntimeException: OUTPUT:
Catchable fatal error: Argument 3 passed to Symfony\Bundle\FrameworkBundle\Controller\TraceableControllerResolver::__construct() must be an instance of Symfony\Component\HttpKernel\Debug\Stopwatch, instance of Symfony\Bundle\FrameworkBundle\Controller\ControllerNameParser given, called in /tmp/2.1.0-DEV/StandardFormLogin/cache/securitybundletest/appSecuritybundletestDebugProjectContainer.php on line 94 and defined in /home/vagrant/builds/kriswallsmith/symfony/src/Symfony/Bundle/FrameworkBundle/Controller/TraceableControllerResolver.php on line 37
```

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

by pablodip at 2012-01-10T14:18:45Z

As you don't need forms to use the csrf provider, how about putting its service without the form prefix? It could even make sense to put the CsrfProvider as a component since you can use it standalone and in more cases than only forms. It would be a small component though.

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

by Tobion at 2012-01-10T17:54:14Z

I think it would be more clear to generate the token in the controller. Doing so in the template will spread the CSRF intention across template and controller. So I don't think this extension is necessary.

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

by kriswallsmith at 2012-01-10T17:58:14Z

@pablodip I'm open to the idea of a Csrf component. This would be a good place for some nonce classes as well.

@Tobion I disagree. One use case is for a list of users, each with a delete form. Iterating over the users in the controller and generating a token for each, just to iterate over them again in the view is a waste and adds complexity.

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

by Tobion at 2012-01-10T18:05:14Z

I see. But I don't understand why the intention needs to be different for each user to delete. Usually the intention is the same for each form type. I thought this is enough.

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

by kriswallsmith at 2012-01-10T18:06:13Z

Yes, a static intention would suffice.

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

by Tobion at 2012-01-10T18:07:08Z

Then your use case is not valid anymore.

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

by Tobion at 2012-01-10T18:12:25Z

I would suggest to make a cookbook article out of it about how to create a simple form without the form component.
And include such things as validating the result using the validator component and checking the CSRF.

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

by kriswallsmith at 2012-01-10T21:32:50Z

This helper makes it easier to use CSRF protection without a form and we should make it as easy as possible. Spreading the intention across controller and template is not concerning to me. Either way, a cookbook entry is a great idea.

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

by Tobion at 2012-01-10T21:47:12Z

Well, it's just one line more without this helper. So I disagree it makes it really easier when you know how to use the CsrfProvider which is a pre-condition anyway since you must still validate its correctness by hand.

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

by kriswallsmith at 2012-01-13T13:24:15Z

Another use case is when rendering a page with a bunch of simple buttons with different intentions: delete user, delete comment, follow, unfollow... Creating all of these in the controller just leads to spaghetti.

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

by jwage at 2012-01-17T21:55:53Z

👍 lots of use cases for something like this @OpenSky
2012-01-22 10:31:29 +01:00
Fabien Potencier 61ab4dcbf2 updated CHANGELOG for 2.1 2012-01-22 10:27:24 +01:00
Fabien Potencier 6b9a355fb0 merged branch blogsh/dynamic_constraints (PR #3114)
Commits
-------

92f820a Renamed registerConstraints to loadDynamicValidatorMetadata
dd12ff8 CS fix, getConstraints renamed
09c1911 [Validator] Improved dynamic constraints
54cb6e4 [Validator] Added dynamic constraints

Discussion
----------

[Validator] Dynamic constraints

Bug fix: no
Feature addition: yes
Backwards compatibility break: no
Symfony2 tests pass: yes

By now the Validator component is based on a per-class configuration of
constraints, but in some cases it might be neccessary to add new constraints
dynamically at runtime.
This pull request adds a "ConstraintProviderInterface" to the Validator component. If an object is validated that implements this interface the method "getConstraints" is used to add dynamic constraints:

    class User implements ConstraintProviderInterface
    {
        protected $isPremium;
        protected $paymentInformation;

        public function getConstraints(ClassMetadata $metadata)
        {
            if ($this->isPremium) {
                $metadata->addPropertyConstraint('paymentInformation', new NotBlank());
            }
        }
    }

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

by alexandresalome at 2012-01-15T11:20:04Z

Related to #1151

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

by canni at 2012-01-16T09:22:28Z

👍

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

by bschussek at 2012-01-16T12:32:44Z

I think this is a good addition. I think we still have a naming problem though. When constraints are loaded using a static method, the default name for the loader method is `loadValidatorMetadata`. Since the method for dynamic constraint loading is basically the same, I think the two names should be related.

Solution (1): Rename the method in your interface to `loadDynamicValidatorMetadata`. Ugly and long.

    class MyClass implements ConstraintProviderInterface
    {
        public static loadValidatorMetadata(ClassMetadata $metadata) ...

        public loadDynamicValidatorMetadata(ClassMetadata $metadata) ...
    }

Solution (2): Rename the default method name in `StaticMethodLoader` to `registerConstraints` and adjust the docs. Breaks BC.

    class MyClass implements ConstraintProviderInterface
    {
        public static registerConstraints(ClassMetadata $metadata) ...

        public registerDynamicConstraints(ClassMetadata $metadata) ...
    }

@fabpot: Are we allowed to break BC here? If not, we should probably stick to (1).

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

by fabpot at 2012-01-16T12:36:14Z

I would prefer to not break BC if possible.

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

by blogsh at 2012-01-16T15:25:46Z

So "loadDynamicValidatorMetadata" would be the best solution?

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

by althaus at 2012-01-17T13:39:19Z

>So "loadDynamicValidatorMetadata" would be the best solution?

Sounds fine for me based on @bschussek's comment.
2012-01-22 10:26:39 +01:00
Fabien Potencier 811ead8589 [Serializer] fixed unit tests after previous merge + added a new one 2012-01-22 10:20:46 +01:00
Fabien Potencier 54e14e7b11 merged branch sprain/sprain/xml-encoder-cdata (PR #3134)
Commits
-------

9cb513f Now… no more tabs!
7f34643 [Pull Request 3134] Improved code based on comments
90abc0f [Serializer][XmlEncoder] add CDATA padding only if necessary

Discussion
----------

[Serializer][XmlEncoder] add CDATA padding only if necessary

Changed XML encoder so CDATA padding is only added to value if necessary.

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

by fabpot at 2012-01-17T21:34:59Z

You should add some unit tests.
2012-01-22 10:17:12 +01:00
Fabien Potencier 90fcbde685 merged branch canni/fix_cs (PR #3146)
Commits
-------

3cfaade [CS] Fix usage of assertCount

Discussion
----------

[CS] Fix usage of assertCount

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

[![Build Status](https://secure.travis-ci.org/canni/symfony.png)](http://travis-ci.org/canni/symfony)
2012-01-22 10:15:34 +01:00
Gerard van Helden 7c338de412 changed docs as proposed in #3110 2012-01-22 10:13:52 +01:00
Fabien Potencier 3c0b9c5b20 [DoctrineBridge] enhanced an error message (closes #3155) 2012-01-22 10:12:26 +01:00
Fabien Potencier c7ec49c624 merged branch lstrojny/feature/form-http-delete (PR #3159)
Commits
-------

0b7e2e0 Support for DELETE method in forms

Discussion
----------

[Form] Support DELETE HTTP verb

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

As `Symfony\Component\HttpFoundation\Request` already support DELETE requests nicely by parsing the request for us, support for the HTTPs DELETE verb can be easily done.

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

by mvrhov at 2012-01-20T06:00:49Z

This is wrong. The body for DELETE method is supposed to be empty or if present ignored.
Also the DELETE is supposed to remove the resource identified by uri, so the same code as for GET should be executed.

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

by lstrojny at 2012-01-20T08:56:22Z

I don’t think that’s the case. The HTTP standard does not state explicitly that DELETE does not have a body. See this [StackOverflow thread](http://stackoverflow.com/questions/2539394/rest-http-delete-and-parameters)
2012-01-22 10:05:04 +01:00
Fabien Potencier 09694999b8 merged branch timewasted/patch-1 (PR #3158)
Commits
-------

9e55cda Only call recover() when spool is a Swift_FileSpool
d2a0c74 Use if/else instead of ternary operator
15c666b Add a "recover-timeout" option to allow recovering messages that have taken too long to send

Discussion
----------

[SwiftmailerBundle] Add a "recover-timeout" option to swiftmailer:spool:send

This would allow for easy resending of messages that were marked as being sent, but for whatever reason were never actually sent.
2012-01-22 09:38:58 +01:00
Fabien Potencier 2c962419dc merged branch umpirsky/serbian-translation-update (PR #3167)
Commits
-------

f6b3ea2 New validation messages and translated to Serbian language.

Discussion
----------

New validation messages and translated to Serbian language.

It would be nice for translators to be notified somehow when new validation messages appear. I copied those from French translation, not sure if that is the right way to go?

Also, in addition, I would like to contribute sr@latin translation. To explain, Serbian language have dual alphabet, both cyrillic and latin. I'm not sure if Symfony locale supports locale variants? Can you suggest right translation file name for this?

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

by stof at 2012-01-21T19:20:31Z

Please send the ids up to 41 to the 2.0 branch. Only 42 and above are new in 2.1

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

by stof at 2012-01-21T19:23:48Z

Regarding serbian latin translations, there is an issue here: both cyrillic and latin serbian share the same locale id ``sr_SP``

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

by stof at 2012-01-21T19:33:01Z

ok, looking a bit more about it, it seems like the right way to handle this is to use ``sr_Latn`` and ``sr_Cyrl`` for the 2 variants

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

by umpirsky at 2012-01-21T20:28:37Z

But ids 42 and above can be merged to master (2.1), right?

I think they share `sr_RS`, not `sr_SP` as you said.

So, `validators.sr.xlf` should be renamed to `validators.sr_Cyrl.xlf` and for latig added `validators.sr_Latn.xlf`?

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

by stof at 2012-01-21T21:00:18Z

yeah, but previous ids should be merged in 2.0 first to avoid merge conflicts later

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

by umpirsky at 2012-01-21T22:37:15Z

Done https://github.com/symfony/symfony/pull/3168
2012-01-22 07:34:36 +01:00
Fabien Potencier a5220313f6 Merge branch '2.0'
* 2.0:
  Updated Serbian translation.
  fixed CS
  [Locale][Testing] Fixed breaking tests if 'intl' extension is not installed (#3139)
  [Bridge] [Twig] fixed typo in a comment of the Twig FormExtension extension.
2012-01-22 07:33:58 +01:00
Fabien Potencier a0818c753e merged branch umpirsky/2.0 (PR #3169)
Commits
-------

1f733e1 Updated Serbian translation.

Discussion
----------

Updated Serbian translation.

Fixed as requested by stof https://github.com/symfony/symfony/pull/3167#issuecomment-3598347
2012-01-22 07:33:27 +01:00
Sasa Stamenkovic 1f733e1168 Updated Serbian translation. 2012-01-21 23:34:49 +01:00
Fabien Potencier cbb184c076 merged branch alexandresalome/fix-form-choice-translation-expanded (PR #3166)
Commits
-------

0513eb1 [Form] Pass translation domain to the sub-forms when choice list is expanded

Discussion
----------

[Form] Pass translation domain to the sub-forms when choice list is expanded

* Bug fix: yes
* Tests pass: yes
* Feature addition: no
* BC compatibility break: no

When you have a select list with ``translation_domain``, you loose translations by expanding the list.

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

by stof at 2012-01-21T14:55:31Z

👍

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

by fabpot at 2012-01-21T16:51:17Z

Why not doing that in the 2.0 branch instead?

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

by stof at 2012-01-21T17:26:32Z

@fabpot because the support of translation domains is a 2.1 feature
2012-01-21 21:20:56 +01:00
Sasa Stamenkovic f6b3ea2d07 New validation messages and translated to Serbian language. 2012-01-21 19:53:48 +01:00
Fabien Potencier ccdeccbce2 merged branch canni/avoid_rendering_id (PR #3145)
Commits
-------

693d1ec [Form] Do not render default ID attribute on empty form name

Discussion
----------

[Form] Do not render default ID attribute on empty form name

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

[![Build Status](https://secure.travis-ci.org/canni/symfony.png)](http://travis-ci.org/canni/symfony)

This is cleanup after enabling empty form names, now form with empty name
will not render the default `id="form"` container attribute.
Developers can extend/override this behaviour by standard form theming methods.

See discussion [here](https://github.com/symfony/symfony/pull/2936/files)
2012-01-21 17:54:49 +01:00
alexandresalome 0513eb1a4f [Form] Pass translation domain to the sub-forms when choice list is expanded 2012-01-21 14:19:08 +01:00
Ryan 9e55cdaeec Only call recover() when spool is a Swift_FileSpool 2012-01-21 00:49:31 -08:00
Lars Strojny 0b7e2e035a Support for DELETE method in forms 2012-01-20 01:04:31 +01:00