Commit Graph

20077 Commits

Author SHA1 Message Date
Fabien Potencier 1d45ca894b Merge branch '2.6' into 2.7
* 2.6: (21 commits)
  [FrameworkBundle] Fix title and placeholder rendering in php form templates.
  [TwigBridge] Removed duplicated code from TwigRenderer
  [Translator][Logging] implement TranslatorBagInterface.
  RequestDataCollector - small fix
  renamed composer.phar to composer to be consistent with the Symfony docs
  [FrameworkBundle] bumped min version of Routing to 2.3
  removed composer --dev option everywhere
  fixed a test
  [Console] Fixed output bug, if escaped string in a formatted string.
  “console help” ignores --raw option
  Fix form icon position in web profiler
  [Security] Remove ContextListener's onKernelResponse listener as it is used
  Revert "minor #12652 [HttpFoundation] [Hackday] #9942 test: Request::getContent() for null value (skler)"
  Revert "fixed assertion"
  fixed assertion
  [HttpFoundation] [Hackday] #9942 test: Request::getContent() for null value
  fixed URL
  Add reference to documentation in FormEvents phpdocs
  [YAML] Fix one-liners to work with multiple new lines
  Keep "pre" meaning for var_dump quick-and-dirty debug
  ...

Conflicts:
	src/Symfony/Bridge/Twig/composer.json
	src/Symfony/Bundle/FrameworkBundle/composer.json
	src/Symfony/Component/Security/Http/Firewall/ContextListener.php
	src/Symfony/Component/Security/Http/Tests/Firewall/ContextListenerTest.php
2015-02-11 08:17:51 +01:00
Fabien Potencier 38f03bd2f5 Merge branch '2.3' into 2.6
* 2.3:
  [FrameworkBundle] Fix title and placeholder rendering in php form templates.
  RequestDataCollector - small fix
  renamed composer.phar to composer to be consistent with the Symfony docs
  [FrameworkBundle] bumped min version of Routing to 2.3
  removed composer --dev option everywhere
  fixed a test
  [Console] Fixed output bug, if escaped string in a formatted string.
  [Security] Remove ContextListener's onKernelResponse listener as it is used
  Revert "minor #12652 [HttpFoundation] [Hackday] #9942 test: Request::getContent() for null value (skler)"
  Revert "fixed assertion"
  fixed assertion
  [HttpFoundation] [Hackday] #9942 test: Request::getContent() for null value
  fixed URL
  Add reference to documentation in FormEvents phpdocs
  [YAML] Fix one-liners to work with multiple new lines
  Keep "pre" meaning for var_dump quick-and-dirty debug
  [Console][Table] Fix cell padding with multi-byte

Conflicts:
	src/Symfony/Bundle/FrameworkBundle/Resources/views/Form/widget_attributes.html.php
	src/Symfony/Bundle/FrameworkBundle/composer.json
	src/Symfony/Component/Console/Helper/TableHelper.php
2015-02-11 08:12:14 +01:00
Fabien Potencier 917067e940 bug #13647 [FrameworkBundle] Fix title and placeholder rendering in php form templates (jakzal)
This PR was merged into the 2.3 branch.

Discussion
----------

[FrameworkBundle] Fix title and placeholder rendering in php form templates

Small fix for rendering placeholder on widgets in php templates.

| Q             | A |
| ------------- | --- |
| Bug fix?      | yes |
| New feature?  | no |
| BC breaks?    | no |
| Deprecations? | no |
| Tests pass?   | no |
| Fixed tickets | - |
| License       | MIT |
| Doc PR        | - |

This is a test case for #13290, including a fix applied on 2.3, since that's the earliest supported branch the bug exist.

In 2.6 the template is a bit different, and unfortunately I couldn't re-use #13290's fix.

When this is merged into 2.3, and then to 2.6 I think we can also merge #13290.

Commits
-------

f82193d [FrameworkBundle] Fix title and placeholder rendering in php form templates.
2015-02-11 08:05:50 +01:00
Jakub Zalas f82193db99 [FrameworkBundle] Fix title and placeholder rendering in php form templates. 2015-02-10 17:14:04 +00:00
Fabien Potencier cad9e0f69d feature #13463 [WebProfilerBundle] Replaced raster PNG icons with vector SVG icons (sgrodzicki)
This PR was merged into the 2.7 branch.

Discussion
----------

[WebProfilerBundle] Replaced raster PNG icons with vector SVG icons

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #13298
| License       | MIT
| Doc PR        | -

Follow up of #13298 : inline svg is supported by the same browsers that support data-uri+svg

Commits
-------

00e3a42 Replaced raster PNG icons with vector SVG icons
2015-02-10 17:23:56 +01:00
Fabien Potencier d0c1c534b2 minor #13638 [TwigBridge] Removed duplicated code from TwigRenderer (hason)
This PR was submitted for the 2.7 branch but it was merged into the 2.6 branch instead (closes #13638).

Discussion
----------

[TwigBridge] Removed duplicated code from TwigRenderer

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

See https://github.com/symfony/symfony/blob/2.7/src/Symfony/Component/Form/FormRenderer.php#L65-L69

Commits
-------

1a9aca7 [TwigBridge] Removed duplicated code from TwigRenderer
2015-02-10 17:22:44 +01:00
Martin Hasoň 1a9aca7152 [TwigBridge] Removed duplicated code from TwigRenderer 2015-02-10 17:22:35 +01:00
Fabien Potencier 8b12bf967a bug #13608 Fix form icon position in web profiler (sadikoff)
This PR was merged into the 2.6 branch.

Discussion
----------

Fix form icon position in web profiler

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| License       | MIT

Form icon in web profiler toolbar moved to the left edge
![pe64g11](https://cloud.githubusercontent.com/assets/213810/6077805/4523c5ba-adfb-11e4-9e8c-61c4940cd7c1.png)

This fix changes icon position to its default value.

Commits
-------

b128439 Fix form icon position in web profiler
2015-02-10 17:18:48 +01:00
Fabien Potencier 85c7195ad7 bug #13642 [Translator][Logging] implement TranslatorBagInterface. (aitboudad)
This PR was merged into the 2.6 branch.

Discussion
----------

[Translator][Logging] implement TranslatorBagInterface.

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Fixed tickets  | #13632
| Tests pass?   | yes
| License       | MIT

Commits
-------

dcb2306 [Translator][Logging] implement TranslatorBagInterface.
2015-02-10 15:54:53 +01:00
Fabien Potencier 1adf54b87f fixed deprecation notice 2015-02-10 15:28:31 +01:00
Abdellatif Ait boudad dcb2306d03 [Translator][Logging] implement TranslatorBagInterface. 2015-02-10 13:48:21 +00:00
Fabien Potencier 97cff759ef feature #13234 [Asset] added the component (fabpot)
This PR was merged into the 2.7 branch.

Discussion
----------

[Asset] added the component

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | yes
| Tests pass?   | yes
| Fixed tickets | #10973, #11748, #11876, #4883, #12474
| License       | MIT
| Doc PR        | not yet

TODO:

 - [ ] submit documentation PR

The current Asset sub-namespace in Templating has several (major) problems:

 * It does not cover all use cases (see #10973 and #4883 for some example)
 * It has some design issues (relies on the Request instance and so requires the request scope, very coupled with the PHP templating sub-system, see #11748 and #11876)

To decouple this feature and make it reusable in Silex for instance, and to fix the design issues and make it more extensible, I've decided to extract and rework the features provided into a new Asset component.

Basically, this component allows the developer to easily manage asset URLs: versioning, paths, and hosts.

Both the new and the old asset management features are kept in this PR to avoid breaking BC; the old system is of course deprecated and automatically converted to the new one.

Even if the features are quite similar, and besides the flexilibity of the new system, here are some differences:

 * `PathPackage` always prepend the path (even if the given path starts with `/`).
 * Usage is stricter (for instance, `PathPackage` requires a basePath to be passed and `UrlPackage` requires that at least on URL is passed).
 * In the configuration, named packages inherits from the version and version format of the default package by default.
 * It is not possible to override the version when asking for a URL (instead, you can define your own version strategy implementation -- the use cases explained in #6092 are easily implemented this way).
 * It's not possible to generate absolute URLs (see #13264 for a better alternative using composition; so using `absolute_url(asset_path('me.png')) should work)`.

#10973 was about adding shortcuts for bundles, which is a good idea; but given that you rarely reference built-in or third-party bundle assets and because we now have a one-bundle default approach named AppBundle, the same can be achieved with just a simple piece of configuration with the new assets feature:

```yml
framework:
    assets:
        packages:
            app:
                base_path: /bundles/app/
            img:
                base_path: /bundles/app/images/
```

Then:

```jinja
{{ asset('images/me.png', 'app') }}
# /bundles/app/images/me.png

{{ asset('me.png', 'img') }}
# /bundles/app/images/me.png
```

#12474 discussed the possibility to add a version for absolute URL. It's not possible to do that in a generic way as the version strategy involves both the version and the path, which obviously cannot work when the path is an absolute URL already. Instead, one should use the `asset_version` Twig function to add the version manually.

Commits
-------

0750d02 removed usage of the deprecated forms of asset() in the core framework
f74a1f2 renamed asset_path() to asset() and added a BC layer
4d0adea [Asset] added a NullContext class
d33c41d [Asset] added the component
2015-02-10 14:18:49 +01:00
Fabien Potencier 0750d02025 removed usage of the deprecated forms of asset() in the core framework 2015-02-10 13:59:19 +01:00
Fabien Potencier f74a1f2dc3 renamed asset_path() to asset() and added a BC layer 2015-02-10 13:45:46 +01:00
Fabien Potencier 4d0adeae16 [Asset] added a NullContext class 2015-02-10 13:45:00 +01:00
Fabien Potencier d33c41d436 [Asset] added the component 2015-02-10 13:45:00 +01:00
Fabien Potencier 9a70bbbdb2 minor #13624 removed composer --dev option everywhere (fabpot)
This PR was merged into the 2.3 branch.

Discussion
----------

removed composer --dev option everywhere

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

Commits
-------

0fe4913 renamed composer.phar to composer to be consistent with the Symfony docs
af59316 removed composer --dev option everywhere
2015-02-10 09:04:11 +01:00
Fabien Potencier ce95fa8fb3 minor #13629 RequestDataCollector - small fix (ovr)
This PR was submitted for the master branch but it was merged into the 2.3 branch instead (closes #13629).

Discussion
----------

RequestDataCollector - small fix

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| License       | MIT

Commits
-------

7ed48db RequestDataCollector - small fix
2015-02-09 20:53:11 +01:00
Дмитрий Пацура 7ed48db94c RequestDataCollector - small fix 2015-02-09 20:53:11 +01:00
Fabien Potencier 0fe4913079 renamed composer.phar to composer to be consistent with the Symfony docs 2015-02-08 08:41:14 +01:00
Fabien Potencier bfa181bd65 [FrameworkBundle] bumped min version of Routing to 2.3 2015-02-08 08:36:25 +01:00
Fabien Potencier af59316536 removed composer --dev option everywhere 2015-02-08 08:33:54 +01:00
Fabien Potencier 004e5abbd6 fixed a test 2015-02-08 08:28:06 +01:00
Fabien Potencier a43a58ccff bug #13607 [Console] Fixed output bug, if escaped string in a formatted string. (tronsha)
This PR was submitted for the 2.7 branch but it was merged into the 2.3 branch instead (closes #13607).

Discussion
----------

[Console] Fixed output bug, if escaped string in a formatted string.

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| License       | MIT

If there is a escaped tag in a formatted string, the output wasn't correct.

I have add a test for this problem and integrated a solution for this.

Commits
-------

1c62eb7 [Console] Fixed output bug, if escaped string in a formatted string.
2015-02-08 08:25:55 +01:00
Stefan Hüsges 1c62eb77e0 [Console] Fixed output bug, if escaped string in a formatted string. 2015-02-08 08:25:54 +01:00
Fabien Potencier ac389b6714 feature #11379 Added new Forwarded header support for Request::getClientIps (tony-co)
This PR was submitted for the master branch but it was merged into the 2.7 branch instead (closes #11379).

Discussion
----------

Added new Forwarded header support for Request::getClientIps

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #11073
| License       | MIT
| Doc PR        | no

Commits
-------

4c8a25a Added new Forwarded header support for Request::getClientIps
2015-02-08 08:21:15 +01:00
Tony Cosentino 4c8a25a6e2 Added new Forwarded header support for Request::getClientIps 2015-02-08 08:21:15 +01:00
Fabien Potencier 8b10043dad bug #13611 [Console] “console help” ignores --raw option (c960657)
This PR was submitted for the 2.7 branch but it was merged into the 2.6 branch instead (closes #13611).

Discussion
----------

[Console] “console help” ignores --raw option

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| License       | MIT

The option for DescriptorHelper::describe() is `raw_text`, not `raw`.

Commits
-------

eabc5d8 “console help” ignores --raw option
2015-02-08 08:19:48 +01:00
Christian Schmidt eabc5d8e92 “console help” ignores --raw option 2015-02-08 08:19:48 +01:00
Fabien Potencier 51a8b11ecd bug #13606 [Form][DoctrineBridge] Optimize EntityType by only loading choices for values restricted by values (guilhermeblanco)
This PR was merged into the 2.7 branch.

Discussion
----------

[Form][DoctrineBridge] Optimize EntityType by only loading choices for values restricted by values

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| License       | MIT

Optimize EntityType by only loading choices for values in the same way that EntityLoader customization does (if you provide a query_builder).

Commits
-------

2185883 Optimize EntityType by only loading choices for values in the same way that EntityLoader customization does (if you provide a query_builder).
2015-02-08 07:49:29 +01:00
Vladimir Sadicov b12843971c Fix form icon position in web profiler 2015-02-06 12:24:56 +02:00
Guilherme Blanco 2185883520 Optimize EntityType by only loading choices for values in the same way that EntityLoader customization does (if you provide a query_builder). 2015-02-05 17:41:00 +00:00
Fabien Potencier 542f60457d feature #9782 [Security] added string representation for core Users (tobiassjosten)
This PR was submitted for the master branch but it was merged into the 2.7 branch instead (closes #9782).

Discussion
----------

[Security] added string representation for core Users

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

I often use type casting and `__toString()` to print my users as this lets me very easily keep one canonical format for their representation. In functional tests however, it is easier to use in-memory users but this defaults to instances of the core `User` object. Because these don't have a string representation all the nice type casting crashes.

Hence I propose to represent the core Users by their username string by default. It would be useful in a lot of cases and I can't see any harm in it?

Commits
-------

722c3a7 [Security] added string representation for core Users
2015-02-05 16:54:07 +01:00
Tobias Sjösten 722c3a77d3 [Security] added string representation for core Users 2015-02-05 16:54:07 +01:00
Fabien Potencier 1882cb1b50 feature #12174 [TwigBundle] Add loader priority (wizhippo)
This PR was submitted for the master branch but it was merged into the 2.7 branch instead (closes #12174).

Discussion
----------

[TwigBundle] Add loader priority

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

Add the ability to specify a priority to the tag of `twig.loader` services.

eg:
```
        <service id="twig.loader.filesystem" class="%twig.loader.filesystem.class%" public="false">
            <argument type="service" id="templating.locator" />
            <argument type="service" id="templating.name_parser" />
            <tag name="twig.loader" priority="100"/>
        </service>
```

Commits
-------

67dffea Add Twig loader priority
2015-02-05 16:17:39 +01:00
wizhippo 67dffea346 Add Twig loader priority 2015-02-05 16:17:38 +01:00
Fabien Potencier d9c0c55ace bug #13466 [Security] Remove ContextListener's onKernelResponse listener as it is used (davedevelopment)
This PR was squashed before being merged into the 2.3 branch (closes #13466).

Discussion
----------

[Security] Remove ContextListener's onKernelResponse listener as it is used

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

The context listeners are specific to a particular firewall, and as such, should not be applied if the current request doesn't match that context listener. To avoid this, the context listener can remove itself from the dispatcher as it is called.

This comes in to affect when two or more firewalls are setup and using the same kernel for multiple requests.  Assuming there are two firewalls 'site' and 'admin'

- Request comes in matching 'site' firewall, 'site' ContextListener adds it's onKernelResponse method to the dispatcher
- Succesful auth for 'site'
- ContextListener writes token to session
- Request comes in matching 'admin' firewall, 'admin' ContextListener can't find anything in the session, so nulls the token in the security context
- 'site' ContextListener listens for response, can't find a token in the security context so removes the 'site' token from the session

Commits
-------

380d805 [Security] Remove ContextListener's onKernelResponse listener as it is used
2015-02-05 11:02:25 +01:00
Dave Marshall 380d8052ac [Security] Remove ContextListener's onKernelResponse listener as it is used 2015-02-05 11:01:10 +01:00
Fabien Potencier 58fcb8d515 Revert "minor #12652 [HttpFoundation] [Hackday] #9942 test: Request::getContent() for null value (skler)"
This reverts commit 09225c7466, reversing
changes made to a0298331ad.
2015-02-05 10:45:43 +01:00
Fabien Potencier 6e9768c8b9 Revert "fixed assertion"
This reverts commit b0a4c38465.
2015-02-05 10:45:38 +01:00
Fabien Potencier b0a4c38465 fixed assertion 2015-02-05 10:43:13 +01:00
Fabien Potencier 09225c7466 minor #12652 [HttpFoundation] [Hackday] #9942 test: Request::getContent() for null value (skler)
This PR was submitted for the master branch but it was merged into the 2.3 branch instead (closes #12652).

Discussion
----------

[HttpFoundation] [Hackday] #9942 test: Request::getContent() for null value

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #9942
| License       | MIT
| Doc PR        |

Implementing test for issue #9942 to confirm that the bug is already fixed. It's possibile to close the issue.

Thanks also to @baiolo, @andyroid1978 for contributions at HackDay of the SymfonyConf

Commits
-------

0b9f310 [HttpFoundation] [Hackday] #9942 test: Request::getContent() for null value
2015-02-05 10:42:23 +01:00
Mauro Foti 0b9f310055 [HttpFoundation] [Hackday] #9942 test: Request::getContent() for null value 2015-02-05 10:42:22 +01:00
Fabien Potencier a0298331ad fixed URL 2015-02-05 10:28:56 +01:00
Fabien Potencier c5b50f28f5 minor #12626 Add reference to documentation in FormEvents phpdocs (ifdattic)
This PR was squashed before being merged into the 2.3 branch (closes #12626).

Discussion
----------

Add reference to documentation in FormEvents phpdocs

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | no
| Fixed tickets | #12512
| License       | MIT
| Doc PR        |

Commits
-------

2b33ba6 Add reference to documentation in FormEvents phpdocs
2015-02-05 10:26:57 +01:00
Andrew M 2b33ba618c Add reference to documentation in FormEvents phpdocs 2015-02-05 10:26:27 +01:00
Fabien Potencier 25441343c6 Merge branch '2.6' into 2.7
* 2.6:
  [FrameworkBundle] fixed tests
  [FrameworkBundle][config cmd] initialize extension.
2015-02-05 09:35:11 +01:00
Fabien Potencier e73c5546a9 Merge branch '2.5' into 2.6
* 2.5:
  [FrameworkBundle] fixed tests
2015-02-05 09:35:03 +01:00
Fabien Potencier 7126c8d5d2 [FrameworkBundle] fixed tests 2015-02-05 09:31:48 +01:00
Fabien Potencier bc75c36e03 bug #12864 [Console][Table] Fix cell padding with multi-byte (ttsuruoka)
This PR was merged into the 2.3 branch.

Discussion
----------

[Console][Table] Fix cell padding with multi-byte

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | N/A
| License       | MIT
| Doc PR        | N/A

When the `TableHelper` dealing with East Asian text, it renders wrong widths. This fixes that problem.

Commits
-------

11014c2 [Console][Table] Fix cell padding with multi-byte
2015-02-05 09:10:27 +01:00