Commit Graph

6657 Commits

Author SHA1 Message Date
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
Fabien Potencier
7720cb9be4 [HttpKernel] tagged public @api 2011-07-20 10:14:31 +02:00
Fabien Potencier
7dcbcbe69d [HttpFoundation] tagged public @api 2011-07-20 10:06:02 +02:00
Johannes Schmitt
eae6a773c6 fixed wrong case 2011-07-20 08:43:26 +02:00
Fabien Potencier
311d691670 [HttpKernel] split ExceptionHandler::handle() in two methods for better re-usability 2011-07-19 22:27:03 +02:00
Johannes Schmitt
d0a175b6cd fixes #1659 2011-07-19 20:51:30 +02:00
Fabien Potencier
d3a69e3531 [DoctrineBundle] renamed RegistryInterface::getEntityManagerForObject() to getEntityManagerForClass() 2011-07-19 19:24:57 +02:00
Fabien Potencier
9e7cb0a020 [Routing] fixed default value for Routes as they can be anything if they don't need to be used as default values for placeholders 2011-07-19 19:18:29 +02:00
Johannes Schmitt
f300edebe4 fixes several bugs 2011-07-19 16:21:58 +02:00
Johannes Schmitt
a4f05ac7ab added some tests 2011-07-19 14:50:39 +02:00
Fabien Potencier
dafa4d28d6 [FrameworkBundle] made another small optimization for functional tests 2011-07-19 13:11:12 +02:00
Fabien Potencier
1454d61ad5 [FrameworkBundle] made a huge speed optimization for functional tests 2011-07-19 12:51:57 +02:00
Fabien Potencier
d2e9f14597 merged branch schmittjoh/routerFix (PR #1720)
Commits
-------

9bcce9f fix tests
fc4787a fix non-extensible router

Discussion
----------

Router fix

Right now, the router is hard to overwrite (you need always a compiler pass). This commit fixes this.

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

by fabpot at 2011/07/18 01:15:36 -0700

Why do you need a complier pass to override the router?

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

by schmittjoh at 2011/07/18 01:47:47 -0700

How would you suggest to overwrite it?

Basically, I want to do something like this:

```yml
services:
    router:
         parent: router.default
         class: MyClass
         calls:
             - [moreDeps, []]
```

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

by Seldaek at 2011/07/18 05:07:19 -0700

Then maybe we should somehow support redefining services with the same name while keeping the old one as parent, otherwise we need this foo.default for every service out there?

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

by fabpot at 2011/07/18 06:30:34 -0700

as @Seldeak said, why do that for the router and not all services?

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

by schmittjoh at 2011/07/18 06:38:39 -0700

I have designed the SecurityBundle this way where extension is encouraged.

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

by schmittjoh at 2011/07/18 11:15:57 -0700

I should add that this is mainly a problem for services where you still want to use the semantic configuration that is provided by the bundle. For services which are not configured by the extension, this is not so much of an issue.

Anyway, if you don't want to merge it, just close the PR. I have no problem with using a compiler pass.

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

by fabpot at 2011/07/18 11:55:11 -0700

We already have such a case with translator and translator.real. I will review the existing services to see where it makes sense to implement the same strategy.

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

by Seldaek at 2011/07/18 12:20:55 -0700

I guess you'd do it anyway, but we should pick a winner between .real and .default

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

by lsmith77 at 2011/07/18 12:26:52 -0700

I would prefer ".default" as ".real" always confused me.
2011-07-19 12:06:28 +02:00
Fabien Potencier
b4b8f35da2 renamed translator.real to translator.default 2011-07-19 12:05:51 +02:00