Commit Graph

6520 Commits

Author SHA1 Message Date
Eric Clemmons
03c7cfed5e UrlGenerator no longer appends '?' if query string is empty 2011-07-22 11:53:54 -07:00
Fabien Potencier
eb7c86b7a8 [HttpKernel] removed the need to keep the compiled classes in the container 2011-07-22 19:10:59 +02:00
Fabien Potencier
e16c226a5c [HttpKernel] changed the way compiled classes are managed to be sure that they are included before the Kernel is booted
If not, as classes can be loaded during the boot, there is no way to be sure that
a class will not be already loaded by a third party bundle.

If the Kernel is already booted, we don't included the compiled classes.
2011-07-22 18:52:34 +02:00
Fabien Potencier
e91ca34ead updated UPDATE file 2011-07-22 17:45:02 +02:00
Fabien Potencier
e9d82506f7 merged branch marcw/revert-1758 (PR #1769)
Commits
-------

d43d621 [Form] Reverted PR #1758.

Discussion
----------

[Form] Reverted PR #1758.

Revert "[Form] CollectionType now checks for data_class parameter instead of only class."

This reverts commit 2e024f87a3.

Conflicts:

	tests/Symfony/Tests/Component/Form/Extension/Core/Type/CollectionTypeTest.php

Revert "[Form] Added ObjectFactoryListener. Fixes #1746."

This reverts commit 0327beb0b9.

Conflicts:

	tests/Symfony/Tests/Component/Form/Extension/Core/Type/CollectionTypeTest.php
2011-07-22 17:43:42 +02:00
Fabien Potencier
1cec45c421 [BrowserKit] fixed test insulation on Mac 2011-07-22 17:40:14 +02:00
marc.weistroff
d43d621829 [Form] Reverted PR #1758.
Revert "[Form] CollectionType now checks for data_class parameter instead of only class."

This reverts commit 2e024f87a3.

Conflicts:

	tests/Symfony/Tests/Component/Form/Extension/Core/Type/CollectionTypeTest.php

Revert "[Form] Added ObjectFactoryListener. Fixes #1746."

This reverts commit 0327beb0b9.

Conflicts:

	tests/Symfony/Tests/Component/Form/Extension/Core/Type/CollectionTypeTest.php
2011-07-22 16:42:50 +02:00
Fabien Potencier
20a704431e [SecurityBundle] fixed typo in tests 2011-07-22 14:50:38 +02:00
Fabien Potencier
aab0bf7e2c merged branch schmittjoh/httpUtilFixes (PR #1739)
Commits
-------

eae6a77 fixed wrong case
d0a175b fixes #1659
f300ede fixes several bugs
a4f05ac added some tests

Discussion
----------

Http util fixes

Fixes several bugs in the http utils.

Please don't add anymore features without sufficient tests. Especially for the Security\Http namespace, regressions are very likely otherwise.

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

by fabpot at 2011/07/19 22:37:26 -0700

Tests do not pass for me:

    There were 2 errors:

    1) Symfony\Bundle\SecurityBundle\Tests\Functional\LocalizedRoutesAsPathTest::testLoginLogoutProcedure with data set #0 ('en')
    InvalidArgumentException: The current node list is empty.

    .../src/Symfony/Component/DomCrawler/Crawler.php:604
    .../src/Symfony/Bundle/SecurityBundle/Tests/Functional/LocalizedRoutesAsPathTest.php:16

    2) Symfony\Bundle\SecurityBundle\Tests\Functional\LocalizedRoutesAsPathTest::testLoginLogoutProcedure with data set #1 ('de')
    InvalidArgumentException: The current node list is empty.

    .../src/Symfony/Component/DomCrawler/Crawler.php:604
    .../src/Symfony/Bundle/SecurityBundle/Tests/Functional/LocalizedRoutesAsPathTest.php:16

    --

    There were 4 failures:

    1) Symfony\Bundle\SecurityBundle\Tests\Functional\LocalizedRoutesAsPathTest::testAccessRestrictedResource with data set #0 ('en')
    Failed asserting that two strings are equal.
    --- Expected
    +++ Actual
    @@ @@
    -http://localhost/en/login
    +http://localhost/login

    .../src/Symfony/Bundle/Securitybundle/Tests/Functional/WebTestCase.php:22
    .../src/Symfony/Bundle/SecurityBundle/Tests/Functional/LocalizedRoutesAsPathTest.php:38

    2) Symfony\Bundle\SecurityBundle\Tests\Functional\LocalizedRoutesAsPathTest::testAccessRestrictedResource with data set #1 ('de')
    Failed asserting that two strings are equal.
    --- Expected
    +++ Actual
    @@ @@
    -http://localhost/de/login
    +http://localhost/login

    .../src/Symfony/Bundle/Securitybundle/Tests/Functional/WebTestCase.php:22
    .../src/Symfony/Bundle/SecurityBundle/Tests/Functional/LocalizedRoutesAsPathTest.php:38

    3) Symfony\Bundle\SecurityBundle\Tests\Functional\LocalizedRoutesAsPathTest::testAccessRestrictedResourceWithForward with data set #0 ('en')
    HTTP/1.0 302 Found
    Cache-Control:  no-cache
    Content-Length: 299
    Content-Type:   text/html; charset=UTF-8
    Date:           Wed, 20 Jul 2011 05:36:27 GMT
    Location:       http://localhost/login
    Set-Cookie: PHPSESSID=11c9c6a7e7620e13bddef223a5ba46d9; path=/; domain=

    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
            <meta http-equiv="refresh" content="1;url=http://localhost/login" />
        </head>
        <body>
            Redirecting to <a href="http://localhost/login">http://localhost/login</a>.
        </body>
    </html>
    Failed asserting that <integer:0> matches expected <integer:1>.

    .../src/Symfony/Bundle/SecurityBundle/Tests/Functional/LocalizedRoutesAsPathTest.php:50

    4) Symfony\Bundle\SecurityBundle\Tests\Functional\LocalizedRoutesAsPathTest::testAccessRestrictedResourceWithForward with data set #1 ('de')
    HTTP/1.0 302 Found
    Cache-Control:  no-cache
    Content-Length: 299
    Content-Type:   text/html; charset=UTF-8
    Date:           Wed, 20 Jul 2011 05:36:28 GMT
    Location:       http://localhost/login
    Set-Cookie: PHPSESSID=2bbe63786a088471ade3717917f4ba4f; path=/; domain=

    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
            <meta http-equiv="refresh" content="1;url=http://localhost/login" />
        </head>
        <body>
            Redirecting to <a href="http://localhost/login">http://localhost/login</a>.
        </body>
    </html>
    Failed asserting that <integer:0> matches expected <integer:1>.

    .../src/Symfony/Bundle/SecurityBundle/Tests/Functional/LocalizedRoutesAsPathTest.php:50

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

by schmittjoh at 2011/07/19 23:47:29 -0700

I fixed a wrong case, but I couldn't reproduce the other errors (tested on Ubuntu).

My guess is that the temporary directory on your machine couldn't be deleted for some reason, and the test runs with the configuration of some of the previous tests.

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

by fabpot at 2011/07/20 00:28:41 -0700

That does not make any difference for me. For instance, in `LocalizedRoutesAsPathTest::testLoginLogoutProcedure()`, the first request to `'/'.$locale.'/login'` returns the following Response:

    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
            <meta http-equiv="refresh" content="1;url=http://localhost/login" />
        </head>
        <body>
            Redirecting to <a href="http://localhost/login">http://localhost/login</a>.
        </body>
    </html>

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

by schmittjoh at 2011/07/20 00:31:34 -0700

That's weird, did you make sure that the temporary directory does not exist?

``rm -Rf /tmp/StandardFormLogin/``

On Wed, Jul 20, 2011 at 9:28 AM, fabpot <
reply@reply.github.com>wrote:

> That does not make any difference for me. For instance, in
> `LocalizedRoutesAsPathTest::testLoginLogoutProcedure()`, the first request
> to `'/'.$locale.'/login'` returns the following Response:
>
>    <html>
>        <head>
>            <meta http-equiv="Content-Type" content="text/html;
> charset=utf-8" />
>            <meta http-equiv="refresh" content="1;url=
> http://localhost/login" />
>        </head>
>        <body>
>            Redirecting to <a href="http://localhost/login">
> http://localhost/login</a>.
>        </body>
>    </html>
>
> --
> Reply to this email directly or view it on GitHub:
> https://github.com/symfony/symfony/pull/1739#issuecomment-1613504
>

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

by fabpot at 2011/07/20 00:33:40 -0700

Yes, I've just checked and the directory does not exist.

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

by schmittjoh at 2011/07/20 00:39:55 -0700

Sorry, I can't reproduce it on Ubuntu and unless someone wants to sponsor me a Mac, there is not much I can do.
2011-07-22 14:45:54 +02:00
Fabien Potencier
cc07af2449 [ClassLoader] replaced MapFileClassLoader by MapClassLoader 2011-07-22 14:44:33 +02:00
Fabien Potencier
5d9bd6da4f [TwigBundle] fixed XSS in the exception template 2011-07-22 13:42:59 +02:00
Fabien Potencier
6419456de4 [Security] change a comparison to use a strict comparison 2011-07-22 13:37:59 +02:00
Fabien Potencier
9bf6216a85 added missing ' escaping 2011-07-22 13:37:23 +02:00
Fabien Potencier
c6115cee7f [BrowserKit] changed Cookie::fromString() to not take the secure setting into account if the URL is not present or is not HTTPS 2011-07-22 13:29:57 +02:00
Fabien Potencier
f29da2fcc8 merged branch marcw/form-prototype-attribute (PR #1724)
Commits
-------

257f86c [Form] Collection's prototype is not not a child anymore.
2b4cc9b [Form] Changed collection prototype rendering.

Discussion
----------

[Form] Changed collection prototype rendering

Based on PR #1500. It is now rendered inside an attribute of collection
tag.

The data-attribute can be retrieved using this piece of jQuery code. You aways will need to adapt it. I think this will be also doable with plain JS.

```javascript
<script type="text/javascript">
        jQuery('p.add-child').click(function() {
            var prototype = $('form #id').attr('data-prototype');
            prototype = prototype.replace(/\$\$name\$\$/g, 'levelxx');
            $('#id').append(prototype);
        });
</script>
```

Closes #1497

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

by beberlei at 2011/07/18 06:40:40 -0700

form div[data-prototype]? What about forms with two collections?

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

by marcw at 2011/07/18 07:25:51 -0700

My bad, the javascript snippet is not crystal clear. Actually, you'll have to specify the div's id to retrieve the right `data-prototype` attribute.
The good way of doing this is by specifying the div's id in the selector (like in the 2nd part of the js example), like this :

    var prototype = $('form #level1_level2_level3_level3').attr('data-prototype');

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

by tystr at 2011/07/18 12:32:39 -0700

+1

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

by marcw at 2011/07/22 01:46:08 -0700

thanx @vicb ! :)
2011-07-22 11:04:08 +02:00
marc.weistroff
257f86cb20 [Form] Collection's prototype is not not a child anymore. 2011-07-22 11:03:06 +02:00
marc.weistroff
2b4cc9bd06 [Form] Changed collection prototype rendering.
Based on PR 1500. It is now rendered inside an attribute of collection
tag.
2011-07-22 11:01:55 +02:00
Fabien Potencier
49dda530e0 merged branch marcw/issue-1746 (PR #1758)
Commits
-------

2e024f8 [Form] CollectionType now checks for data_class parameter instead of only class.
0327beb [Form] Added ObjectFactoryListener. Fixes #1746.

Discussion
----------

[Form] Added ObjectFactoryListener. Fixes #1746.

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

by marcw at 2011/07/21 09:32:17 -0700

This patch also fixes a validation issue because it was impossible for the validator to validate an array.

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

by stof at 2011/07/21 09:47:46 -0700

yeah, using the data_class of the prototype would be great
2011-07-22 10:11:44 +02:00
Fabien Potencier
d96c152c4c [HttpKernel] fixed error message in HttpKernel 2011-07-22 09:55:31 +02:00
Fabien Potencier
84abbbd6df [HttpKernel] enhanced the ExceptionHandler so that it can be used in prod environment too (mainly useful for Silex) 2011-07-22 09:38:05 +02:00
Fabien Potencier
3f3f8e8002 [ClassLoader] removed obsolete code 2011-07-21 23:27:21 +02:00
Fabien Potencier
6b0a9ff784 [HttpKernel] changed the compiled class cache to non-adaptative (as it is now loaded very early) 2011-07-21 22:33:29 +02:00
Fabien Potencier
e776d5dbce [FrameworkBundle] tweaked compiled class cache 2011-07-21 22:32:50 +02:00
Fabien Potencier
cede13e8cc [FrameworkBundle] moved the SessionListener to the session.xml configuration file 2011-07-21 22:32:21 +02:00
Fabien Potencier
ccda267c36 [FrameworkBundle] fixed wrong order in classes to compile 2011-07-21 21:44:10 +02:00
Fabien Potencier
7062cc2db5 [HttpKernel] fixed compiled classes 2011-07-21 21:32:57 +02:00
Fabien Potencier
e5eab90169 Revert "merged branch trompette/patch-1 (PR #1761)"
This reverts commit 8e3b9c334d, reversing
changes made to 61f02902fe.
2011-07-21 21:32:57 +02:00
Fabien Potencier
b06a5dfcf3 merged branch andreia/master (PR #1760)
Commits
-------

350f207 Update the CSRF message

Discussion
----------

Update the CSRF message

Update the CSRF message
2011-07-21 20:57:10 +02:00
Fabien Potencier
8e3b9c334d merged branch trompette/patch-1 (PR #1761)
Commits
-------

e2b249d fixed typo

Discussion
----------

fixed typo
2011-07-21 20:56:57 +02:00
Fabien Potencier
61f02902fe added missing information in UPDATE file 2011-07-21 20:44:42 +02:00
marc.weistroff
2e024f87a3 [Form] CollectionType now checks for data_class parameter instead of only class. 2011-07-21 19:50:40 +02:00
Fabien Potencier
db9a37530e udpated UPDATE file 2011-07-21 19:28:44 +02:00
Fabien Potencier
3749ad43f4 moved the Exception listener from FrameworkBundle to TwigBundle as it relies on Twig being enabled
This commit also fixes exception pages when Twig is not enabled as a templating engine.
Instead of just displaying the raw Twig template as before, we now fallback to the default
exception handler introduced some time ago.
2011-07-21 19:24:04 +02:00
Benoît Merlet
e2b249da08 fixed typo 2011-07-21 09:35:16 -07:00
Andreia Bohner
350f2076ba Update the CSRF message 2011-07-21 12:47:42 -03:00
marc.weistroff
0327beb0b9 [Form] Added ObjectFactoryListener. Fixes #1746. 2011-07-21 15:02:52 +02:00
Fabien Potencier
08730b604b merged branch andreia/master (PR #1754)
Commits
-------

cb37572 Update the Brazilian Portuguese validator translations and fix typo
e0e4778 Revert "Update the Brazilian Portuguese validator translations and fix typo"
63f0707 Update the Brazilian Portuguese validator translations and fix typo

Discussion
----------

Update pt_BR translations

Update the Brazilian Portuguese validator translations and fix typo
2011-07-21 04:43:13 +02:00
Andreia Bohner
cb37572b58 Update the Brazilian Portuguese validator translations and fix typo 2011-07-20 21:58:46 -03:00
Andreia Bohner
e0e4778fe6 Revert "Update the Brazilian Portuguese validator translations and fix typo"
This reverts commit 63f0707df6.
2011-07-20 21:00:45 -03:00
Andreia Bohner
63f0707df6 Update the Brazilian Portuguese validator translations and fix typo 2011-07-20 20:51:35 -03:00
Fabien Potencier
6108b8dedc merged branch usefulthink/fix-interal-uri-generator (PR #1747)
Commits
-------

79e4ed6 simplified assignment
04302ff simplified ternary-operator
3a285c1 fixed handling of null-values in attribute- and query-arrays

Discussion
----------

[FrameworkBundle] fixed handling of null-values in attribute- and query-arrays

when esi is enabled and internal uris are generated for esi-tags, an
attribute-array consisting entirely of null-values isn't handled correctly.

The reason is that php's `http_build_query()`-method outputs an empty string
for such arrays:

    http_build_query(array('foo' => '')) == 'foo='
    http_build_query(array('foo' => null)) == ''

In the latter case, the generation of an URI in [`HttpKernel::generateInternalUri()`][code1]
generates an URI that could not be matched by the corresponding route (ex.
`_internal/Controller/.html` opposed to `_internal/Controller/none.html` which
should be expected).

This commit adds a possible solution as well as a simple test for this issue.

[code1]: https://github.com/symfony/symfony/blob/master/src/Symfony/Bundle/FrameworkBundle/HttpKernel.php#L179
2011-07-20 17:35:32 +02:00
Martin Schuhfuss
79e4ed661b simplified assignment 2011-07-20 17:29:23 +02:00
Martin Schuhfuss
04302ffe98 simplified ternary-operator 2011-07-20 17:27:36 +02:00
Martin Schuhfuss
3a285c1548 fixed handling of null-values in attribute- and query-arrays
when esi is enabled and internal uris are generated for esi-tags, an
attribute-array consisting entirely of null-values isn't handled correctly.

The reason is that php's `http_build_query()`-method outputs an empty string
for such arrays:

    http_build_query(array('foo' => '')) == 'foo='
    http_build_query(array('foo' => null)) == ''

In the latter case, the generation of an URI in `HttpKernel::generateInternalUri()`
generates an URI that could not be matched by the corresponding route (ex.
`_internal/Controller/.html` opposed to `_internal/Controller/none.html` which
should be expected).

This commit adds a possible solution as well as a simple test for this issue.
2011-07-20 17:03:20 +02:00
Fabien Potencier
e42a2dede1 [Validator] fixed unit tests when intl is not installed 2011-07-20 14:45:35 +02:00
Fabien Potencier
e5fa78af31 [Form] fixed unit tests when intl is not installed 2011-07-20 14:36:55 +02:00
Fabien Potencier
8333df6161 fixed autoloader when tests are run on a machine without intl installed 2011-07-20 14:27:10 +02:00
Fabien Potencier
97cb35b47a [DependencyInjection] tagged the public @api 2011-07-20 10:50:27 +02:00
Fabien Potencier
b36c002fa4 [Validator] tagged the public @api 2011-07-20 10:37:57 +02:00
Fabien Potencier
5c06b3cfeb [Templating] tagged the public @api 2011-07-20 10:27:25 +02:00