Commit Graph

7040 Commits

Author SHA1 Message Date
pborreli
f68c0286cc [CI] travis-ci.org integration 2011-11-22 19:57:22 +01:00
Fabien Potencier
60f8525ae5 merged branch lsmith77/forward_compat (PR #2526)
Commits
-------

b6bf018 tweaked error handling for the forward compatibility
dd606b5 added note about the purpose of this class
c1426ba added locale handling forward compatibility
10eed30 added MessageDataCollector forward compatibility

Discussion
----------

Forward compat

Bug fix: no
Feature addition: yes
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: #2522
2011-11-22 19:39:27 +01:00
hlecorche
38f64a1bd9 [Form] added some unit tests 2011-11-22 10:31:25 +01:00
Fabien Potencier
bb025bb904 merged branch hlecorche/valid-form-w3c (PR #2676)
Commits
-------

78e9b2f [Form] Fixed textarea_widget (W3C standards)

Discussion
----------

[Form] Fixed textarea_widget (W3C standards)

Textarea widget included the "pattern" attribute but is not valid by W3C standards.

(See PR 2666 - New PR because rebase inside the 2.0 branch)

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

by fabpot at 2011/11/18 09:01:41 -0800

@hlecorche: Thanks for your work on this issue. Can you update the unit tests to be sure that this case is covered? If you're not comfortable with this, just tell me and I will do it myself

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

by hlecorche at 2011/11/19 02:51:06 -0800

@fabpot: I did'nt commited because I am not sure. I changed the "tests/Symfony/Tests/Component/Form/AbstractLayoutTest.php" file :

    public function testTextarea()
    {
        $form = $this->factory->createNamed('textarea', 'na&me', 'foo&bar', array(
            'property_path' => 'name',
            'pattern' => 'foo',
        ));

        $this->assertWidgetMatchesXpath($form->createView(), array(),
    '/textarea
    [@name="na&me"]
    [not(@pattern)]
    [.="foo&bar"]
    '
        );
    }

Is it correct?
2011-11-22 10:25:58 +01:00
Fabien Potencier
48c0f50fa2 [Form] tweaked an exception message 2011-11-22 10:24:03 +01:00
Fabien Potencier
af2713261d merged branch canni/throw_exception_on_form_name_circulal_ref (PR #2675)
Commits
-------

36cebf0 Fix infinite loop on circullar reference in form factory

Discussion
----------

[BugFix][Form]Throw exception on form name circulal ref

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

When FormType method `getName()` returns the same value as `getParent()` we're asking about trouble, and land into infinite loop.
2011-11-22 10:21:50 +01:00
Fabien Potencier
7c8d836331 merged branch willdurand/undefined-value-property-path (PR #2266)
Commits
-------

57e1aeb Fixed undefined index notice in readProperty() method (PropertyPath)

Discussion
----------

Fixed undefined index notice in readProperty() method (PropertyPath)

Hi,

For some reasons, I get `notice` errors on `readProperty()` with Propel:

    Notice: Undefined index: 0 in /Users/william/projects/Propel/testProjects/symfony2/vendor/symfony/src/Symfony/Component/Form/Util/PropertyPath.php line 284

The `PropelObjectCollection` implements `ArrayAccess`, the `readProperty()` method does not check if the given `index` exists so the `notice` error is thrown. I suppose to check whether the index exists or not has to be added.

Regards,
William

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

by fabpot at 2011/09/27 23:42:07 -0700

The patch is probably not what we want to do. First, I suppose that you are not creating the propertyPath by hand. If that is the case, we need to understand why the property path does not exist. Then, even if we might want to check the existence of the index, if it does not exist, we should probably throw an exception instead of just ignoring the problem.

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

by willdurand at 2011/09/28 01:14:49 -0700

My bad. This is a Propel bug due to `ArrayObject`. It throws a notice error if the index is not found in `offsetGet()` which is wrong according to the `ArrayAccess` interface. If the index is not found, we have to return `null`.

@fabpot Are you agree with that (for the `null` value) ?

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

by fabpot at 2011/09/28 01:17:09 -0700

My point is that it should never happen under normal circumstances.

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

by willdurand at 2011/09/28 01:23:55 -0700

@fabpot Not sure to get it.

The fact is that it tries to get the value (`getValue()`) of a fresh object, just added to the `collection` when I'm submitting a form with a `CollectionType` and a new entry in it.
I mean it tries to get this new object (not yet persisted, not yet in the collection) in the collection (`getValue()` -> `readProperty()`) which implements `ArrayAccess` but this object cannot be in the collection at this time.

Am I wrong ?

And, without this notice error thrown by Propel, I probably never opened this issue...

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

by willdurand at 2011/09/29 06:40:34 -0700

@fabpot: you can try this example: http://www.propelorm.org/cookbook/symfony2/mastering-symfony2-forms-with-propel.html#manytomany_relations in order to make your own tests. Will it be enough?
As I said, it throws a weird notice for the reasons above.

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

by jaugustin at 2011/10/04 12:58:10 -0700

any news on this ?
@fabpot did you have time to look at the test case ?

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

by cedriclombardot at 2011/11/09 14:29:42 -0800

@fabpot: can we have news about this ?
2011-11-22 09:55:47 +01:00
pborreli
1fb90397c4 [FrameworkBundle] Skipping one test failing on PHP5.3.2 2011-11-22 07:40:01 +01:00
Fabien Potencier
7edd9118cc merged branch ondrowan/patch-2 (PR #2689)
Commits
-------

1dcf74a Fixed small typo in phpdoc.

Discussion
----------

Small typo in phpdoc

Awkward, but I couldn't resist...
2011-11-22 07:39:34 +01:00
ondrowan
1dcf74ab70 Fixed small typo in phpdoc. 2011-11-21 21:11:59 +01:00
Fabien Potencier
d4f1721336 [Swiftmailer] fixed composer.json 2011-11-18 17:32:56 +01:00
hlecorche
78e9b2fedb [Form] Fixed textarea_widget (W3C standards) 2011-11-18 17:31:57 +01:00
Dariusz Górecki
36cebf0924 Fix infinite loop on circullar reference in form factory
When `->getName()` returns the same as `getParent()` we're going to infinite loop.
2011-11-18 14:23:22 +01:00
Fabien Potencier
12299c4de9 merged branch kriswallsmith/form/checkbox-view (PR #2661)
Commits
-------

79ae3fc [Form] fixed radio and checkbox when data is not bool

Discussion
----------

[Form] fixed checkbox view

The checkbox view was being built based on app data, not client data. This fixes it.

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

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

by fabpot at 2011/11/16 13:31:09 -0800

`RadioType` suffers from the same problem, no?

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

by kriswallsmith at 2011/11/16 13:32:50 -0800

Yeah, I'll fix that too.

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

by kriswallsmith at 2011/11/16 13:43:29 -0800

Updated to include `RadioType`.
2011-11-17 07:05:47 +01:00
Fabien Potencier
d2d4e716ec merged branch drak/vendors (PR #2652)
Commits
-------

86a8b9f Allow vendors checkout transport method to be overridden manually.

Discussion
----------

Allow vendors checkout transport method to be overridden manually.

In one particular environment I cannot checkout using vendors.php using the default http:// transport methods, but only git://

This patch gives complete freedom to override the default.

Side note: http:// as a transport method at github is deprecated as all http:// urls redirect to https://

My motivation for this patch is to allow continuous integration (previous phing patch closed which included this required change) since multiple regular checkouts to github via http protocol get blocked more but git based protocol transport don't.  Without this, vendors.php may not always work and it's required to get the dependencies in order to be able to run the unit tests.

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

by stealth35 at 2011/11/15 06:14:32 -0800

If `http` is deprecated why you put this in default ?

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

by drak at 2011/11/15 06:26:17 -0800

Since the current list of checkouts is using `http`, I just left it.  I try to keep topic branches laser focused so it's clear what the change was about.  If you would like, I can change it because it actually makes sense.  By the way, I double checked with `curl -I http://github.com/symfony/symfony.git` and the only response is a redirect to `https`.

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

by drak at 2011/11/15 18:40:16 -0800

Reopening on `master`.

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

by drak at 2011/11/15 21:32:09 -0800

Ok I've rebased this branch and force updated the branch so it's against 2.0 and has the changes discussed.
2011-11-17 07:04:39 +01:00
Fabien Potencier
8fa8d964a9 merged branch meonkeys/2.0 (PR #2654)
Commits
-------

4fbcc20 UPDATE.md: trivial markdown syntax fix

Discussion
----------

UPDATE.md: trivial markdown syntax fix

Sorry if this is so trivial it's annoying. I just fix 'em as I find 'em, and I keep commits small.
2011-11-17 07:02:48 +01:00
Fabien Potencier
d1ae6c7cb6 bumped Symfony version in composer.json files to 2.0.7 2011-11-17 06:58:47 +01:00
Fabien Potencier
3ef8079b50 bumped Symfony version to 2.0.7-DEV 2011-11-17 06:58:18 +01:00
Kris Wallsmith
79ae3fced9 [Form] fixed radio and checkbox when data is not bool 2011-11-16 13:39:36 -08:00
Fabien Potencier
b55a43813e updated VERSION for 2.0.6 2011-11-16 20:35:49 +01:00
Fabien Potencier
021601771d update CONTRIBUTORS for 2.0.6 2011-11-16 20:35:23 +01:00
Fabien Potencier
3b686150d8 updated CHANGELOG for 2.0.6 2011-11-16 20:34:42 +01:00
Drak
86a8b9f567 Allow vendors checkout transport method to be overridden manually. 2011-11-16 11:09:17 +05:45
Adam Monsen
4fbcc202f6 UPDATE.md: trivial markdown syntax fix 2011-11-15 10:19:29 -08:00
Fabien Potencier
7af5f598d9 merged branch tacker/2.0 (PR #2641)
Commits
-------

8399574 Fixes a small php doc issue of Symfony\Component\Console\Command\Command::setDefinition()

Discussion
----------

Fixes a small php doc issue of Symfony\Component\Console\Command\Command::setDefinition()

Have setDefinition() accept InputDefinition instead of Definition.
2011-11-15 07:59:56 +01:00
Fabien Potencier
2978c28ce5 merged branch stof/db_tests (PR #2644)
Commits
-------

58c2276 Skipped tests when PDO is not available

Discussion
----------

Skipped tests when PDO is not available

Some tests are failing with an exception when PDO SQLite is not available. This skips them instead.
2011-11-15 07:59:42 +01:00
Fabien Potencier
262bf54d51 merged branch drak/doctrinebundles_tests (PR #2650)
Commits
-------

f83ef1e [DoctrineBundle] Fix tests - incorrect class names (copy paste error most probably)

Discussion
----------

[DoctrineBundle] Fix tests - incorrect class names

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

Some classes are incorrectly named resulting in failed tests for DoctrineBundle, looks like a copy paste error.
2011-11-15 07:57:44 +01:00
Fabien Potencier
a765c0a7d6 merged branch jdreesen/trans-formatting-fix (PR #2648)
Commits
-------

470f872 [FrameworkBundle] fixed formatting of farsi translation file

Discussion
----------

[FrameworkBundle] fixed formatting of farsi translation file

It now matches the other languages translation files.
2011-11-15 07:57:06 +01:00
Fabien Potencier
40fb7ae7a2 merged branch jdreesen/typo-fix-1 (PR #2647)
Commits
-------

67d91f0 fixed typo in exception message

Discussion
----------

Fixed typo in exception message

Fixed a small typo in the exception message which was added in d67fbe9e
2011-11-15 07:56:41 +01:00
Drak
f83ef1ec4a [DoctrineBundle] Fix tests - incorrect class names (copy paste error most probably) 2011-11-15 07:41:36 +05:45
jdreesen
470f872bf6 [FrameworkBundle] fixed formatting of farsi translation file 2011-11-14 20:33:13 +01:00
jdreesen
67d91f05d4 fixed typo in exception message 2011-11-14 20:16:31 +01:00
Christophe Coevoet
58c227681e Skipped tests when PDO is not available 2011-11-14 18:39:47 +01:00
Markus Tacker
839957487a Fixes a small php doc issue of Symfony\Component\Console\Command\Command::setDefinition() 2011-11-14 14:56:06 +01:00
Fabien Potencier
f7c5bf1db2 [HttpKernel] fixed Content-Length header when using ESI tags (closes #2623) 2011-11-14 13:46:20 +01:00
Fabien Potencier
d67fbe9e48 [HttpFoundation] added an exception to MimeTypeGuesser::guess() when no guesser are available (closes #2636) 2011-11-14 13:21:49 +01:00
Fabien Potencier
0462a89562 [Security] fixed HttpUtils::checkRequestPath() to not catch all exceptions (closes #2637) 2011-11-14 13:10:32 +01:00
Fabien Potencier
769a1e3e0a Merge pull request #2632 from drak/9eb0ef5f106992a5a6300c47e5e03576df578bd2
Grammar fix
2011-11-13 23:10:46 -08:00
Fabien Potencier
c91d90f61e merged branch everzet/dbal-fix (PR #2635)
Commits
-------

24dcd0f [DoctrineBundle] added missing default parameters, needed to setup and use DBAL without ORM

Discussion
----------

[DoctrineBundle] added missing default parameters for DBAL

Without this change, user can't use DBAL without ORM. When user configures only DBAL - he'll get:

    [Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException]
    The service "doctrine" has a dependency on a non-existent parameter "doctrine.entity_managers".
2011-11-14 08:03:41 +01:00
Konstantin Kudryashov
24dcd0faf9 [DoctrineBundle] added missing default parameters, needed to setup and use DBAL without ORM 2011-11-14 01:43:18 +02:00
Drak
9eb0ef5f10 [Transation] Fix grammar.
In English, zero is plural so need to use 'are' - "there are no apples".
English's pluralisation rule is: nplurals=2; plural=n != 1;
2011-11-12 14:30:17 +05:45
Fabien Potencier
b6a98bfc98 merged branch dpb587/patch-trace (PR #2593)
Commits
-------

4858fbe [TwigBundle] Fix trace to not show 'in at line' when file/line are empty.

Discussion
----------

[TwigBundle] Fix trace to not show 'in at line' when file/line are empty.

Occasionally I saw call stacks where file/line are empty in the raw exception object, but the trace.html.twig file was still showing 'in at line' with empty values. I believe this fixes that.

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

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

by fabpot at 2011/11/09 22:49:35 -0800

The current code looks correct to me. Can you try with the latest version of Twig to be sure that you don't have this issue because of a bug in Twig that has been fixed since then?

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

by dpb587 at 2011/11/10 07:20:34 -0800

Thanks for the feedback. Should I change my patch to check that both are defined and non-empty, such as `trace.file is defined and trace.file and trace.line is defined and trace.line`?

I think the issue is that I'm seeing the file and line keys are defined but empty. I created another branch with a pseudo-test case that shows a little more information. Using symfony-standard with symfony in deps as follows and symfony/twig removed from deps.lock.

    [symfony]
        git=git://github.com/dpb587/symfony.git
        version=origin/patch-trace-debug

Then running the following:

    phpunit -c app/ vendor/symfony/tests/Symfony/Tests/Bundle/TwigBundle/Controller/ExceptionController.php

The test (is backwards) and passes, dumping the following (this call happens right after a call_user_func):

    Array
    (
        [namespace] => Symfony\Bundle\FrameworkBundle\EventListener
        [short_class] => RouterListener
        [class] => Symfony\Bundle\FrameworkBundle\EventListener\RouterListener
        [type] => ->
        [function] => onKernelRequest
        [file] =>
        [line] =>
        [args] => Array
            (
                [0] => Array
                    (
                        [0] => object
                        [1] => Symfony\Component\HttpKernel\Event\GetResponseEvent
                    )

            )

    )

I saw the same results with two php versions:

    PHP 5.3.3-7+squeeze3 with Suhosin-Patch (cli) (built: Jun 28 2011 08:24:40)
    Copyright (c) 1997-2009 The PHP Group
    Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
        with Xdebug v2.1.1, Copyright (c) 2002-2011, by Derick Rethans
        with Suhosin v0.9.32.1, Copyright (c) 2007-2010, by SektionEins GmbH

    PHP 5.3.8 (cli) (built: Nov  4 2011 05:43:22)
    Copyright (c) 1997-2011 The PHP Group
    Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies
        with the ionCube PHP Loader v4.0.10, Copyright (c) 2002-2011, by ionCube Ltd., and
        with Zend Guard Loader v3.3, Copyright (c) 1998-2010, by Zend Technologies

Sorry if I'm simply missing something or doing something silly.

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

by fabpot at 2011/11/11 13:12:21 -0800

`trace.file is defined and trace.file and trace.line is defined and trace.line` looks good to me.
2011-11-12 09:19:12 +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
Danny Berger
4858fbe7e0 [TwigBundle] Fix trace to not show 'in at line' when file/line are empty. 2011-11-11 18:20:32 -06: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
bb5fb79c3d changed the way we store the current ob level (refs #2617) 2011-11-11 23:35:49 +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
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