Commit Graph

7339 Commits

Author SHA1 Message Date
Fabien Potencier
c681b68bde Merge branch '2.0'
* 2.0:
  [FrameworkBundle] fixed a unit test
  [Form] Check for normal integers. refs 0427b126c1
  [Form] Replace `an` with `is`
2011-11-12 09:18:01 +01:00
Fabien Potencier
564b4b91ae [FrameworkBundle] fixed a unit test 2011-11-12 09:17:56 +01:00
Fabien Potencier
ff764090b9 merged branch ManuelAC/2.0 (PR #2629)
Commits
-------

462580c [Form] Check for normal integers. refs 0427b126c1
970e2a2 [Form] Replace `an` with `is`

Discussion
----------

[Form] DateTimeToArrayTransformer fix

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

0427b126c1 throws an `TransformationFailedException` if you're using integers. In other words:

`` array('year' => '2011', 'month' => '11', 'day' => '12') = valid ``
`` array('year' => 2011, 'month' => 11, 'day' => 12) = invalid ``
2011-11-12 08:53:33 +01:00
Manuel de Ruiter
462580c06f [Form] Check for normal integers. refs 0427b126c1 2011-11-12 00:58:46 +01:00
Manuel de Ruiter
970e2a2608 [Form] Replace an with is 2011-11-12 00:57:14 +01:00
Fabien Potencier
83b24c5e5b Merge branch '2.0'
* 2.0:
  changed the way we store the current ob level (refs #2617)
2011-11-11 23:36:46 +01:00
Fabien Potencier
bb5fb79c3d changed the way we store the current ob level (refs #2617) 2011-11-11 23:35:49 +01:00
Fabien Potencier
b8e0f411d7 merged 2.0 2011-11-11 23:22:38 +01:00
Fabien Potencier
fb0fffe6db [Validator] fixed a unit test for PHP 5.4 (closes #2585) 2011-11-11 23:22:12 +01:00
Fabien Potencier
21cec043d7 Merge branch '2.0'
* 2.0:
  [Form] fixed previous merge
  [Form] simplified previous merge
  Also identify FirePHP by the X-FirePHP-Version header
  [TwigBundle] Extract output buffer cleaning to method
  [TwigBundle] Do not clean output buffering below initial level
  Fixed rendering of FileType (value is not a valid attribute for input[type=file])
  Added tests for string fix in DateTimeToArrayTransformer (8351a11286).
  Added check for array fields to be integers in reverseTransform method. This prevents checkdate from getting strings as arguments and throwing incorrect ErrorException when submitting form with malformed (string) data in, for example, Date field. #2609
  [Translation] removed unneeded methods
  [Translation] added detection for circular references when adding a fallback catalogue
  [DomCrawler] trim URI in getURI
  [Yaml][Tests] Fixed missing locale string for Windows platforms which caused test to fail
2011-11-11 22:52:07 +01:00
Fabien Potencier
1940bec31b merged branch igorw/phpunit-ob-level (PR #2617)
Commits
-------

29e12af [TwigBundle] Extract output buffer cleaning to method
ed1a6c2 [TwigBundle] Do not clean output buffering below initial level

Discussion
----------

[TwigBundle] Do not clean output buffering below initial level

This resulted in issues with PHPUnit 3.6, which will buffer all output and clean them in the end. Since
we cleaned their buffer, the subsequent clean would raise a warning. This is documented in [issue 390](https://github.com/sebastianbergmann/phpunit/issues/390) of
the PHPUnit tracker.

Closes #2531.

This also affects FOSRestBundle's ExceptionController /cc @lsmith.

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

by fabpot at 2011/11/11 07:33:24 -0800

I have a similar fix locally but I have not merged it yet as it looks a bit dirty (but I've not a better idea yet). Anyway, your PR is better than mine as you've added some unit tests already.
2011-11-11 22:17:55 +01:00
Fabien Potencier
7f32043f19 merged branch jalliot/file_widget (PR #2608)
Commits
-------

e83e00a Fixed rendering of FileType (value is not a valid attribute for input[type=file])

Discussion
----------

Fixed rendering of FileType

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

According to the W3C validator, `value` is not a valid attribute for `input[type=file]`.

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

by fabpot at 2011/11/10 23:01:24 -0800

Instead of creating yet another block, what about modifying the `field_widget` to not render the `value` attribute if the value is empty? Also, the PHP template must be fixed too.

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

by jalliot at 2011/11/11 02:02:52 -0800

@fabpot Changed ;)
2011-11-11 22:01:59 +01:00
Fabien Potencier
0427b126c1 [Form] fixed previous merge 2011-11-11 22:01:46 +01:00
Fabien Potencier
3922fb839a [Form] simplified previous merge 2011-11-11 21:49:47 +01:00
Fabien Potencier
7475a3924c merged branch ondrowan/2.0 (PR #2614)
Commits
-------

2582fcb Added tests for string fix in DateTimeToArrayTransformer (8351a11286).
8351a11 Added check for array fields to be integers in reverseTransform method. This prevents checkdate from getting strings as arguments and throwing incorrect ErrorException when submitting form with malformed (string) data in, for example, Date field. #2609

Discussion
----------

Fix for #2609

Second take for fix for #2609, hope it's ok now. Tests are failing without my fix and passing with it.
2011-11-11 21:48:12 +01:00
Fabien Potencier
78f5ae2815 merged branch rouffj/cs (PR #2624)
Commits
-------

fb0379d Fix some CheckStyle violations on Components.

Discussion
----------

Fix some CheckStyle violations on Components.

On casts, Control signature etc.

This Pull request follow the #2618 (https://github.com/symfony/symfony/pull/2618) where @stof had some trouble to merge it.
2011-11-11 21:18:17 +01:00
Fabien Potencier
1a2b3cffd8 merged branch schniper/patch-2 (PR #2622)
Commits
-------

7cba0a0 Also identify FirePHP by the X-FirePHP-Version header

Discussion
----------

Also identify FirePHP by the X-FirePHP-Version header
2011-11-11 21:17:03 +01:00
Joseph Rouff
fb0379d3b7 Fix some CheckStyle violations on Components.
On casts, Control signature etc.
2011-11-11 20:46:32 +01:00
Fabien Potencier
6140869baa Revert "merged branch drak/eventdispatcher_opimization (PR #2597)"
This reverts commit db6fea9fd0, reversing
changes made to 47b09f791b.
2011-11-11 16:28:23 +01:00
Costin Bereveanu
7cba0a07b6 Also identify FirePHP by the X-FirePHP-Version header 2011-11-11 17:04:36 +02:00
Igor Wiedler
29e12affb0 [TwigBundle] Extract output buffer cleaning to method 2011-11-11 14:54:44 +01:00
Igor Wiedler
ed1a6c2e45 [TwigBundle] Do not clean output buffering below initial level
This resulted in issues with PHPUnit 3.6, which will buffer all output and clean them in the end. Since
we cleaned their buffer, the subsequent clean would raise a warning. This is documented in issue 390 of
the PHPUnit tracker.

Closes #2531.
2011-11-11 12:09:57 +01:00
Jordan Alliot
e83e00a7b8 Fixed rendering of FileType (value is not a valid attribute for input[type=file]) 2011-11-11 11:01:38 +01:00
ondrowan
2582fcb1e1 Added tests for string fix in DateTimeToArrayTransformer (8351a11286). 2011-11-11 10:00:41 +01:00
ondrowan
8351a11286 Added check for array fields to be integers in reverseTransform method. This prevents checkdate from getting strings as arguments and throwing incorrect ErrorException when submitting form with malformed (string) data in, for example, Date field. #2609 2011-11-11 09:58:40 +01:00
Fabien Potencier
6b0e7c8c41 [Translation] removed unneeded methods 2011-11-11 09:02:31 +01:00
Fabien Potencier
db6fea9fd0 merged branch drak/eventdispatcher_opimization (PR #2597)
Commits
-------

0fe8ac6 [EventDispatcher] Removed unused argument.

Discussion
----------

[EventDispatcher] Removed unused parameter in doDispatch().

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

Removed unused parameter.

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

by Seldaek at 2011/11/10 02:30:01 -0800

A simple $foo($arg) is faster than call_user_func, fine, but with all the if/else logic here are you sure it is still faster?

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

by drak at 2011/11/10 06:44:41 -0800

call_user_func is inordinately slow, I'll make some benchmarks. The if logic here is pretty, two conditionals for array callables or one conditional for closures/functions.

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

by drak at 2011/11/10 12:45:27 -0800

After doing some benchmarks, there are savings to be made in all cases except when the listener is an instantiated object when it's marginally slower, so I've reverted these changes and made this PR just to remove the unused argument in `doDispatch()`. You can see the benchmark code here: https://gist.github.com/1356129.

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

by drak at 2011/11/10 12:46:55 -0800

This PR is ready for consideration.
2011-11-11 08:31:28 +01:00
Fabien Potencier
45b218e7c4 [Translation] added detection for circular references when adding a fallback catalogue 2011-11-11 08:29:16 +01:00
Fabien Potencier
632a99fd7c merged branch stealth35/fix_2599 (PR #2601)
Commits
-------

a245e15 [DomCrawler] trim URI in getURI

Discussion
----------

[DomCrawler] trim URI in getURI

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: #2599
2011-11-11 08:09:10 +01:00
Drak
0fe8ac6149 [EventDispatcher] Removed unused argument. 2011-11-11 02:25:05 +05:45
stealth35
a245e15434 [DomCrawler] trim URI in getURI 2011-11-10 15:38:28 +01:00
Fabien Potencier
f8164ec380 merged branch aboks/yaml_inlinetest (PR #2602)
Commits
-------

e7acb23 [Yaml][Tests] Fixed missing locale string for Windows platforms which caused test to fail

Discussion
----------

[Yaml][Tests] Fixed missing locale string for Windows platforms

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

On Windows all the locale formats supplied in the test do not work, causing the test to fail. The added locale string works correctly on (at least) Windows 7.
2011-11-10 13:05:03 +01:00
Arnout Boks
e7acb23636 [Yaml][Tests] Fixed missing locale string for Windows platforms which caused test to fail 2011-11-10 12:50:53 +01:00
Fabien Potencier
47b09f791b merged branch snc/issue-1798-sf21 (PR #2598)
Commits
-------

4d80ebd Remove security token if user was deleted, is disabled or locked to prevent infinite redirect loops to the login path (fixes #1798).

Discussion
----------

[2.1] Fix for issue 1798

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

This is a simplified PR of #2528 for the master branch.
2011-11-10 10:55:51 +01:00
Fabien Potencier
0025673d15 Merge branch '2.0'
* 2.0:
  Added a class to the logs ol element to prevent hiding it when toggling an exception (fixes #2589).
  Remove only the security token instead of the session cookie.
  Clear session cookie if user was deleted, is disabled or locked to prevent infinite redirect loops to the login path (fixes #1798).
2011-11-10 10:55:16 +01:00
Fabien Potencier
3c584f5683 merged branch snc/issue-1798 (PR #2528)
Commits
-------

f9befb6 Remove only the security token instead of the session cookie.
348bccb Clear session cookie if user was deleted, is disabled or locked to prevent infinite redirect loops to the login path (fixes #1798).

Discussion
----------

Fix for issue 1798

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

Clear session cookie if user was deleted, is disabled or locked to prevent infinite redirect loops to the login path (fixes #1798).

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

by snc at 2011/11/01 04:01:49 -0700

@stof I have changed the code so that it only removes the token... do we still need any hook support?

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

by stof at 2011/11/01 04:07:17 -0700

well, the hook is for your own use case but it would be for 2.1 only anyway, not for 2.0

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

by snc at 2011/11/07 15:11:52 -0800

Now that #2414 is merged to 2.1, this could be simplified for the master branch...
2011-11-10 10:54:32 +01:00
Fabien Potencier
877e484529 merged branch snc/issue-2589 (PR #2596)
Commits
-------

932c144 Added a class to the logs ol element to prevent hiding it when toggling an exception (fixes #2589).

Discussion
----------

Fix for issue 2589

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

Added a class to the logs ol element to prevent hiding it when toggling an exception.
2011-11-10 10:52:13 +01:00
H. Westphal
4d80ebd5c8 Remove security token if user was deleted, is disabled or locked to prevent infinite redirect loops to the login path (fixes #1798). 2011-11-10 10:34:33 +01:00
H. Westphal
932c144534 Added a class to the logs ol element to prevent hiding it when toggling an exception (fixes #2589). 2011-11-10 10:20:28 +01:00
Fabien Potencier
5882a98d52 merged branch stealth35/gettext_dumper (PR #2590)
Commits
-------

56cb7a5 [Translation] add gettext PO and MO Dumper

Discussion
----------

[Translation] add gettext PO and MO Dumper

See #2412

    Bug fix: no
    Feature addition: yes
    Backwards compatibility break: no
    Symfony2 tests pass: yes
    Fixes the following tickets: -
2011-11-10 07:50:55 +01:00
stealth35
56cb7a515b [Translation] add gettext PO and MO Dumper 2011-11-10 00:24:31 +01:00
Fabien Potencier
2d53751e13 merged branch thomasbibb/master (PR #2559)
Commits
-------

269a5e6 Added the ablity to get a requests ContentType

Discussion
----------

Added getContentType

I've added the ability for Symfony\Component\HttpFoundation\Request to return the ContentType from serverBag this uses the $formats array to determine if the requested ContentType is valid.

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

by ericclemmons at 2011/11/03 20:00:51 -0700

Have you considered squashing a couple of your commits?  They seem doubled up.

Trivial, I know, but it will make each commit stand on its own (instead of appearing as a typo correction)

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

by thomasbibb at 2011/11/04 02:02:36 -0700

done.

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

by ericclemmons at 2011/11/04 07:25:20 -0700

You may need to do a `git push -f origin master`.  Check the commits tab to see the duplicate history:

> https://github.com/symfony/symfony/pull/2559/commits

Wheeeee, rebasing is fun!

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

by thomasbibb at 2011/11/04 12:26:06 -0700

There we got thats better :)

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

by ericclemmons at 2011/11/04 12:55:07 -0700

👍  Now let's see if it gets approved by @fabpot :)

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

by thomasbibb at 2011/11/06 03:39:12 -0800

I've removed the space between the method name and the parenthesis.

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

by thomasbibb at 2011/11/06 04:05:15 -0800

done.

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

by fabpot at 2011/11/06 23:44:22 -0800

Can you added some unit tests?
2011-11-09 22:08:42 +01:00
Fabien Potencier
56f7626632 updated CHANGELOG for 2.1 2011-11-09 22:02:31 +01:00
Fabien Potencier
8ca8aef151 merged branch stof/gettext_loader (PR #2412)
Commits
-------

d974a4a Merge pull request #4 from stealth35/test_mo_loader
cf05646 delete useless tests
19f9de9 [Translation] fix gettext tests
965f2bf Merge pull request #3 from stealth35/test_mo_loader
9c2a26d [Translation] add Mo loader tests
9af2342 [Translation] Added the gettext loaders

Discussion
----------

[Translation] Added the gettext loaders

This is the squashed version of the work done by @xaav in #634.

@stealth35 you said you will work on the dumpers. do you have some stuff on it ?

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

by drak at 2011/10/24 19:28:43 -0700

Is there any more progress with this?

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

by stealth35 at 2011/10/25 00:57:19 -0700

I work on the dumpers, but the Po loader is wrong, caus' the Po ressource can be multiline,

     msgid ""
     "Here is an example of how one might continue a very long string\n"
     "for the common case the string represents multi-line output.\n"

http://www.gnu.org/software/gettext/manual/gettext.html#PO-Files

Anyway the Po format is an intermediate format to Mo file, (like .txt to .res file for ICU), IMO we can just support the real gettext format : Mo

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

by stealth35 at 2011/11/03 02:00:24 -0700

@stof The MO Dumper is ready (stealth35/symfony@f2d1d5b4de), should we keep the PO format ?

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

by fabpot at 2011/11/07 08:50:59 -0800

@stealth35: The PO is what people will use for their translations. They will then dump it to MO. So, we need both PO and MO loaders and dumpers.

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

by stealth35 at 2011/11/08 01:25:39 -0800

@fabpot, I'm ready for both dumpers, you can merge this, and I'll open a PR for the dumpers

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

by fabpot at 2011/11/08 22:37:47 -0800

I've just had a look at this PR code again and I see that the unit tests are pretty slim. Is it possible to add some tests for the mo loader?

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

by stealth35 at 2011/11/09 01:15:25 -0800

@fabpot test send to @stof ✌️

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

by stof at 2011/11/09 02:22:55 -0800

and merged in this branch

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

by fabpot at 2011/11/09 02:39:09 -0800

The tests do not pass for me:

    There was 1 error:

    1) Symfony\Tests\Component\Translation\Loader\MoFileLoaderTest::testLoadDoesNothingIfEmpty
    InvalidArgumentException: MO stream content has an invalid format.

    /Users/fabien/work/symfony/git/symfony/src/Symfony/Component/Translation/Loader/MoFileLoader.php:79
    /Users/fabien/work/symfony/git/symfony/src/Symfony/Component/Translation/Loader/MoFileLoader.php:46
    /Users/fabien/work/symfony/git/symfony/tests/Symfony/Tests/Component/Translation/Loader/MoFileLoaderTest.php:34

    --

    There was 1 failure:

    1) Symfony\Tests\Component\Translation\Loader\PoFileLoaderTest::testLoad
    Failed asserting that two arrays are equal.
    --- Expected
    +++ Actual
    @@ @@
     Array (
    -    'foo' => 'bar'
     )

    /Users/fabien/work/symfony/git/symfony/tests/Symfony/Tests/Component/Translation/Loader/PoFileLoaderTest.php:25
2011-11-09 22:00:02 +01:00
Fabien Potencier
ad6ffea225 updated CHANGELOG for 2.1 2011-11-09 21:55:11 +01:00
Fabien Potencier
df88070e76 merged branch stealth35/patch-14 (PR #2581)
Commits
-------

796c6b2 [Locale] add getIcuVersion and getIcuDataVersion to Locale

Discussion
----------

[Locale] add getIcuVersion and getIcuDataVersion to Locale

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

by stealth35 at 2011/11/09 00:51:30 -0800

@stof thank for your review
2011-11-09 21:53:59 +01:00
Christophe Coevoet
d974a4a465 Merge pull request #4 from stealth35/test_mo_loader
[Translation] fix gettext tests
2011-11-09 03:13:48 -08:00
stealth35
cf05646cc7 delete useless tests 2011-11-09 12:11:16 +01:00
stealth35
19f9de9e8f [Translation] fix gettext tests 2011-11-09 12:08:40 +01:00
Christophe Coevoet
965f2bf4d2 Merge pull request #3 from stealth35/test_mo_loader
[Translation] add Mo loader tests
2011-11-09 02:22:12 -08:00