Commit Graph

24353 Commits

Author SHA1 Message Date
Fabien Potencier 41c72ab909 minor #21335 [Validator] Improved error message for missing upload_tmp_dir (Breuls)
This PR was merged into the 2.7 branch.

Discussion
----------

[Validator] Improved error message for missing upload_tmp_dir

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

I ran into a problem in which the value for upload_tmp_dir was set in php.ini, but PHP was unable to write to the specified location. PHP returns an UPLOAD_ERR_NO_TMP_DIR in $_FILES when it can't find or use the tmp dir, and my application displayed the error for $uploadNoTmpDirErrorMessage, from which I drew the conclusion that the ini setting was missing or emtpy.

This conclusion was based on the wording in the error message, which explicitly states that 'no temporary folder was configured', which is not actually correct. According to the [PHP documentation](http://php.net/manual/en/features.file-upload.errors.php):

> UPLOAD_ERR_NO_TMP_DIR
> Value: 6; Missing a temporary folder. Introduced in PHP 5.0.3.

'Missing' might be interpreted as 'the value for the ini setting is missing', but also as 'the configured folder is missing'.

I thought it might save someone some time if the error message from the Symfony Validator makes this explicit, which is what this PR aims to do.

I also updated the Dutch and Polish translations, because those, in addition to English, are the languages spoken in my team.

Commits
-------

afbf22746a [Validator] Improved error message for missing upload_tmp_dir
2017-01-21 10:14:52 -08:00
Fabien Potencier b6507c8c1c fixed CS 2017-01-21 08:52:33 -08:00
Fabien Potencier 2ff6f445bc fixed CS fixer config 2017-01-21 08:45:58 -08:00
Fabien Potencier d103b61420 fixed typo 2017-01-21 08:37:56 -08:00
Fabien Potencier 735d0a6ce7 Revert "fixed typo"
This reverts commit 6830d9f4c9.
2017-01-21 08:37:26 -08:00
Fabien Potencier 2b317c1de1 minor #21363 CS fixes (fabpot)
This PR was squashed before being merged into the 2.7 branch (closes #21363).

Discussion
----------

CS fixes

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| 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
-------

6830d9f4c9 fixed typo
5176f978bf fixed CS
2017-01-21 08:34:55 -08:00
Fabien Potencier 6830d9f4c9 fixed typo 2017-01-21 08:33:48 -08:00
Peter Breuls afbf22746a [Validator] Improved error message for missing upload_tmp_dir 2017-01-21 09:48:33 +01:00
Fabien Potencier 5176f978bf fixed CS 2017-01-20 08:54:19 -08:00
Fabien Potencier 77289b9023 bug #21333 [HttpKernel] Fix ArgumentValueResolver for arguments default null (chalasr)
This PR was merged into the 2.7 branch.

Discussion
----------

[HttpKernel] Fix ArgumentValueResolver for arguments default null

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

If an argument has `null` as default value __and annotations are used for routing__, then it is not resolved by the ArgumentResolver e.g:

```php

public function showAction(Request $request) {
   dump($request); // Request object
}

public function showAction(?Request $request) {
   dump($request); // Request object
}

public function showAction(Request $request = null) {
   dump($request); // null
}
```
To me, the last example should have been a Request object too.

Note that it is the same behavior when using `UserInterface` or whatever, I ran into this issue while trying to dump a user for a route accepting both anonymous and authenticated requests, the argument was always null while `$this->getUser()` returned the expected value. According to http://symfony.com/blog/new-in-symfony-3-2-user-value-resolver-for-controllers it should have worked through the argument.

I propose to make it works as a bugfix.
Any suggestion for improving the patch will be really welcomed. ping @iltar

Commits
-------

d3fa8a1859 Avoid setting request attributes from signature arguments in AnnotationClassLoader
2017-01-19 09:09:26 -08:00
Robin Chalas d3fa8a1859 Avoid setting request attributes from signature arguments in AnnotationClassLoader 2017-01-19 17:02:55 +01:00
Fabien Potencier 5ba84cab08 minor #21346 [DependencyInjection] Add some missing typehints in YamlFileLoader (dunglas)
This PR was merged into the 2.7 branch.

Discussion
----------

[DependencyInjection] Add some missing typehints in YamlFileLoader

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| 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
-------

34330e5136 [DependencyInjection] Add some missing typehints in YamlFileLoader
2017-01-19 07:37:36 -08:00
Fabien Potencier 6148457502 minor #21345 [DependencyInjection] minor: Fix a param type (dunglas)
This PR was merged into the 2.7 branch.

Discussion
----------

[DependencyInjection] minor: Fix a param type

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| 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
-------

c82aa84c26 [DependencyInjection] minor: Fix a DocBlock
2017-01-19 07:37:02 -08:00
Kévin Dunglas 34330e5136
[DependencyInjection] Add some missing typehints in YamlFileLoader 2017-01-19 14:51:14 +01:00
Kévin Dunglas c82aa84c26
[DependencyInjection] minor: Fix a DocBlock 2017-01-19 14:34:44 +01:00
Fabien Potencier 419bcf6c58 bug #20871 [HttpKernel] Give higher priority to adding request formats (akeeman)
This PR was submitted for the master branch but it was merged into the 2.7 branch instead (closes #20871).

Discussion
----------

[HttpKernel] Give higher priority to adding request formats

| Q             | A
| ------------- | ---
| Branch?       | 3.2
| Bug fix?      | yes
| New feature?  | yes
| BC breaks?    | yes (unlikely to break projects*)
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | none
| License       | MIT
| Doc PR        | not documented

\* Only applies to the unlikely case where formats are used before this event is loaded key. Users must have specified custom formats, and actually using them should then break their application. I think that's an unlikely case.

## Problem
It's possible to extend the formats known by the `Request` using a piece of config:
```yaml
framework:
    request:
        formats:
            json: 'application/merge-patch+json'
```

Using this in a `kernel.request` event is currently not possible, as it loads after any custom events.

## Offered solution
Increasing the priority of the AddRequestFormatsListener listener resolves this problem.
This change only impacts projects that use the `framework.request.formats` configuration key, as the listener is not loaded if it isn't defined.

Commits
-------

9edb457e44 [HttpKernel] Give higher priority to adding request formats
2017-01-18 11:53:10 -08:00
Arjan Keeman 9edb457e44 [HttpKernel] Give higher priority to adding request formats 2017-01-18 11:53:09 -08:00
Fabien Potencier 1dfb1080b2 minor #21324 [FrameworkBundle] Fix third level headers for MarkdownDescriptor (ogizanagi)
This PR was merged into the 2.7 branch.

Discussion
----------

[FrameworkBundle] Fix third level headers for MarkdownDescriptor

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

`~` is not valid as an underlining char when using markdown on the contrary of reStructuredText.
See the rendering of [builder_1_public.md (before)](https://github.com/symfony/symfony/blob/master/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_public.md)  vs [builder_1_public.md (after)](https://github.com/ogizanagi/symfony/blob/fix/2.7/fwb/md_third_lvl_headers/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/builder_1_public.md) for instance.

This PR fixes it by using a third level header.

~~**EDIT:** There is no BC break. Wrong PR template information.~~

Commits
-------

ce29ab1d92 [FrameworkBundle] Fix third level headers for MarkdownDescriptor
2017-01-17 12:04:54 -08:00
Maxime Steinhausser ce29ab1d92 [FrameworkBundle] Fix third level headers for MarkdownDescriptor 2017-01-17 19:39:37 +01:00
Nicolas Grekas b860ec33a1 bug #21285 [TwigBundle] do not lose already set method calls (xabbuh)
This PR was merged into the 2.7 branch.

Discussion
----------

[TwigBundle] do not lose already set method calls

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

Commits
-------

cb1a4b7 [TwigBundle] do not lose already set method calls
2017-01-14 18:02:28 +01:00
Christian Flothmann cb1a4b778f [TwigBundle] do not lose already set method calls 2017-01-14 10:53:53 +01:00
Christian Flothmann c18c93b51c bug #21279 #20411 fix Yaml parsing for very long quoted strings (RichardBradley)
This PR was merged into the 2.7 branch.

Discussion
----------

#20411 fix Yaml parsing for very long quoted strings

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

This fixes #20411, a YAML string with too many backslash escapes can trigger a `PREG_BACKTRACK_LIMIT_ERROR` error in the Yaml parser.

There should be no behavioural change other than the bug fix

I have included a test which fails before this fix and passes after this fix.

Commits
-------

51bca66 #20411 fix Yaml parsing for very long quoted strings
2017-01-14 08:26:19 +01:00
Richard Bradley 51bca66dfb #20411 fix Yaml parsing for very long quoted strings 2017-01-13 16:26:16 +00:00
Nicolas Grekas aebb65923b minor #21256 [FrameworkBundle] Skip test if xdebug.file_link_format is defined. (lyrixx)
This PR was merged into the 2.7 branch.

Discussion
----------

[FrameworkBundle] Skip test if xdebug.file_link_format is defined.

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

---

The test suite does not pass locally because I use a custom
file_link_format. I do it because it works everywhere.

Then, Symfony tries to read this value before the default one.
We could use ini_set before the test but unfortunatelly there are no way
to define the "cfg_var". For recall, get_cfg_var allows to return the
configuration value even if the extension is not loaded. And again it's
my case: I don't enable xdebug to have better performance.

Commits
-------

7f15bc3 [FrameworkBundle] Skip test if xdebug.file_link_format is defined.
2017-01-13 09:21:07 +01:00
Nicolas Grekas 6430d539ba minor #21264 CS: apply is_null (keradus)
This PR was merged into the 2.7 branch.

Discussion
----------

CS: apply is_null

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

Commits
-------

47feb18 CS: apply is_null
2017-01-13 09:20:14 +01:00
Nicolas Grekas 2cff2f68fa minor #21262 DX: remove invalid inheritdoc (keradus)
This PR was merged into the 2.7 branch.

Discussion
----------

DX: remove invalid inheritdoc

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

those classes do not extend anything, inherit docs on them are wrong

Commits
-------

9e36436 DX: remove invalid inheritdoc
2017-01-13 09:19:35 +01:00
Dariusz Ruminski 47feb18d31 CS: apply is_null 2017-01-12 23:27:26 +01:00
Dariusz Ruminski 9e36436703 DX: remove invalid inheritdoc 2017-01-12 23:09:43 +01:00
Fabien Potencier 6babdb3296 bumped Symfony version to 2.7.24 2017-01-12 12:24:37 -08:00
Fabien Potencier 9073fb2c76 Merge pull request #21258 from fabpot/release-2.7.23
released v2.7.23
2017-01-12 12:02:33 -08:00
Fabien Potencier 69a553a2a3 updated VERSION for 2.7.23 2017-01-12 12:02:12 -08:00
Fabien Potencier fe67ce5209 update CONTRIBUTORS for 2.7.23 2017-01-12 12:02:11 -08:00
Fabien Potencier dd3fbea149 updated CHANGELOG for 2.7.23 2017-01-12 12:02:04 -08:00
Nicolas Grekas 52eeddc24e Fix getMock usage 2017-01-12 20:23:39 +01:00
Nicolas Grekas 49fb0c033c Remove dead code 2017-01-12 20:18:32 +01:00
Grégoire Pineau 7f15bc39ea [FrameworkBundle] Skip test if xdebug.file_link_format is defined.
The test suite does not pass locally because I use a custom
file_link_format. I do it because it works everywhere.

Then, Symfony tries to read this value before the default one.
We could use ini_set before the test but unfortunatelly there are no way
to define the "cfg_var". For recall, get_cfg_var allows to return the
configuration value even if the extension is not loaded. And again it's
my case: I don't enable xdebug to have better performance.
2017-01-12 19:58:07 +01:00
Fabien Potencier 5cf600dfbd bug #21218 [Form] DateTimeToLocalizedStringTransformer does not use timezone when using date only (magnetik)
This PR was merged into the 2.7 branch.

Discussion
----------

[Form] DateTimeToLocalizedStringTransformer does not use timezone when using date only

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

The `DateTimeToLocalizedStringTransformer` when used with a pattern that have only date (in `DateType` for instance) does not convert the result in the desired output

Reproduction steps:
- Use `DateType` in a form
- Set the `model_timezone` to `Pacific/Tahiti`, having default timezone to `Europe/Berlin`.
- Enter the date `2017-01-10`
- Submit the form
- Notice that the received data is `2017-01-10 00:00 Europe/Berlin`, whereas it should be `2017-01-10 11:00 Europe/Berlin`

Commits
-------

031d8c2c8b [Form] DateTimeToLocalizedStringTransformer does not use TZ when using only date
2017-01-12 10:42:17 -08:00
Baptiste Lafontaine 031d8c2c8b [Form] DateTimeToLocalizedStringTransformer does not use TZ when using only date 2017-01-12 15:37:51 +01:00
Nicolas Grekas d7bc68a3ed bug #21104 [FrameworkBundle] fix IPv6 address handling in server commands (xabbuh)
This PR was merged into the 2.7 branch.

Discussion
----------

[FrameworkBundle] fix IPv6 address handling in server commands

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | https://github.com/symfony/symfony/pull/21039#discussion_r93915788
| License       | MIT
| Doc PR        |

This fixes https://github.com/symfony/symfony/pull/21039#discussion_r93915788 as reported by @sstok for the existing commands by backporting @fabpot's patch from #21039.

Commits
-------

2bb4713 fix IPv6 address handling in server commands
2017-01-12 14:01:00 +01:00
Nicolas Grekas 4769ca2164 bug #20793 [Validator] Fix caching of constraints derived from non-serializable parents (uwej711)
This PR was squashed before being merged into the 2.7 branch (closes #20793).

Discussion
----------

[Validator] Fix caching of constraints derived from non-serializable parents

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

This change allows to still cache constraints even when an uncachable constraint (i.e. Callback)
is added to a parent class at runtime.

This is achived by caching only the constraints that are loaded for the class in question only
and merging parent and interface constraints after reading from cache.

Commits
-------

9dd6b0c [Validator] Fix caching of constraints derived from non-serializable parents
2017-01-12 13:52:00 +01:00
Uwe Jäger 9dd6b0cf64 [Validator] Fix caching of constraints derived from non-serializable parents 2017-01-12 13:51:22 +01:00
Fabien Potencier 17ce5f55d1 bug #19586 [TwigBundle] Fix bug where namespaced paths don't take parent bundles in account (wesleylancel)
This PR was squashed before being merged into the 2.7 branch (closes #19586).

Discussion
----------

[TwigBundle] Fix bug where namespaced paths don't take parent bundles in account

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

Currently namespaced paths for templates such as `{% extends '@App/Layout/layout.html.twig' %}` do not work with bundles that have overruled templates using the `getParent()` method in another bundle. See attached ticket. This change prepends the path of the bundle implementing `getParent()` to the paths of the namespace of bundle returned as a parent.

Commits
-------

0c77ce2355 [TwigBundle] Fix bug where namespaced paths don't take parent bundles in account
2017-01-11 10:19:59 -08:00
Wesley Lancel 0c77ce2355 [TwigBundle] Fix bug where namespaced paths don't take parent bundles in account 2017-01-11 10:19:56 -08:00
Fabien Potencier 1c6dfce018 bug #21237 [FrameworkBundle] Fix relative paths used as cache keys (nicolas-grekas)
This PR was merged into the 2.7 branch.

Discussion
----------

[FrameworkBundle] Fix relative paths used as cache keys

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

This bug fix is particularly important on 3.2, where the generated "templates.php" does contain relative paths. This turned out to generate a fatal error on our setup, because of non-normalized twig-cache keys. See also https://github.com/twigphp/Twig/pull/2354
As a bonus, this saves us a copy-on-write on PHP 7.

Commits
-------

5441e9bc90 [FrameworkBundle] Fix relative paths used as cache keys
2017-01-11 08:27:33 -08:00
Nicolas Grekas 5441e9bc90 [FrameworkBundle] Fix relative paths used as cache keys 2017-01-11 16:18:12 +01:00
Fabien Potencier f83ad56b1b bug #21183 [Validator] respect groups when merging constraints (xabbuh)
This PR was merged into the 2.7 branch.

Discussion
----------

[Validator] respect groups when merging constraints

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

Commits
-------

9a60057f42 respect groups when merging constraints
2017-01-10 07:40:08 -08:00
Nicolas Grekas c5847696ea [DI] Add missing legacy group on testLegacy 2017-01-10 15:26:05 +01:00
Nicolas Grekas f03073c103 bug #21179 [TwigBundle] Fixing regression in TwigEngine exception handling (Bertalan Attila)
This PR was merged into the 2.7 branch.

Discussion
----------

[TwigBundle] Fixing regression in TwigEngine exception handling

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

Fixing regression after #20831 in TwigEngine exception handling.

Commits
-------

390cb33 Fixing regression in TwigEngine exception handling.
2017-01-10 14:51:20 +01:00
Nicolas Grekas d18c2cadfc minor #21226 Fix Container and PhpDumper test inaccuracies (nikita2206)
This PR was merged into the 2.7 branch.

Discussion
----------

Fix Container and PhpDumper test inaccuracies

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

Stumbled upon and fixed some minor inaccuracies in tests for DI container, they might have lead to undetected changes of `Container`'s behavior

Commits
-------

24b93cc Fix Container and PhpDumper test inaccuracies
2017-01-10 14:43:59 +01:00
Nicolas Grekas e355739b83 minor #21225 [DI] Dont share service when no id provided (nicolas-grekas)
This PR was merged into the 2.7 branch.

Discussion
----------

[DI] Dont share service when no id provided

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

Commits
-------

814f633 [DI] Dont share service when no id provided
2017-01-10 14:43:16 +01:00