Commit Graph

47107 Commits

Author SHA1 Message Date
Fabien Potencier 9198b9dc97 Merge branch '4.3' into 4.4
* 4.3:
  [FrameworkBundle] remove messenger cache if not enabled
  [HttpClient] Fix strict parsing of response status codes
  [DI] Suggest typed argument when binding fails with untyped argument
2020-01-21 08:39:36 +01:00
Nicolas Grekas ff174dfec3 minor #35178 [PhpUnitBridge][SymfonyTestsListenerTrait] Remove some unneeded code (fancyweb)
This PR was merged into the 3.4 branch.

Discussion
----------

[PhpUnitBridge][SymfonyTestsListenerTrait] Remove some unneeded code

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

Risky errors when there are no assertions are added before the test end listeners are called (ie, before the code in endTest is executed) so forcing beStrictAboutTestsThatDoNotTestAnything to false when there is a expectedDeprecation annotation is enough.

If the goal is to reset the value to the original value, then I think we should not do it since we basically "lie" to the next listeners. Let's assume that when a test expect a deprecation, it can have 0 assertions. Also this flag is not used anymore by PHPUnit after we reset it.

Ref https://github.com/symfony/symfony/pull/21786 btw

Commits
-------

fb48bbc05b [PhpUnitBridge][SymfonyTestsListenerTrait] Remove some unneeded code
2020-01-20 13:28:41 +01:00
Jan Schädlich f703a58215 [FrameworkBundle] Add --show-arguments example to debug:container command help text 2020-01-20 13:24:26 +01:00
Nicolas Grekas 940bba0860 bug #35335 [Security] Fix RememberMe with null password (jderusse)
This PR was merged into the 5.0 branch.

Discussion
----------

[Security] Fix RememberMe with null password

| Q             | A
| ------------- | ---
| Branch?       | 5.0
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | yes
| Tickets       | NA
| License       | MIT
| Doc PR        | NA

From `UserInterface` the method getPassword may return null, while generateCookieHash requires a string.
This PR changes the signature of the methods to allows null password

Commits
-------

a7d0d82768 Fix RememberMe with null password
2020-01-20 13:23:27 +01:00
Nicolas Grekas 0dcf2fcdf5 bug #35339 [String] add missing encoding when calling mb_ord() (nicolas-grekas)
This PR was merged into the 5.0 branch.

Discussion
----------

[String] add missing encoding when calling mb_ord()

| Q             | A
| ------------- | ---
| Branch?       | 5.0
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

Commits
-------

759e20e6d3 [String] add missing encoding when calling mb_ord()
2020-01-20 13:22:08 +01:00
Nicolas Grekas e21b1538f3 bug #35355 [DI] Fix EnvVar not loaded when Loader requires an env var (jderusse)
This PR was merged into the 4.4 branch.

Discussion
----------

[DI] Fix EnvVar not loaded when Loader requires an env var

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | #35348
| License       | MIT
| Doc PR        | NA

When an EnvVarLoader has a dependency on an Env Var tried to be loaded (which is the case for SodiumVault that is configured with `default::SYMFONY_DECRYPTION_SECRET`) the Loader is not usable.

What happens:
- when trying to resolve `SYMFONY_DECRYPTION_SECRET`, the EnvVarProcessor iterates over loaders
- given SodiumVaultLoaders requires the same env variable `SYMFONY_DECRYPTION_SECRET`, it throws a `ParameterCircularReferenceException`
- letting the $loaders generator invalid

This PR, refactor the way loaders are iterated in order to rewind on failure.

Commits
-------

e119aa6c48 [DI] Fix EnvVar not loaded when Loader requires an env var
2020-01-20 13:17:50 +01:00
Nicolas Grekas 67fd73a312 minor #35387 [Console] Fix "Input" typehints (PatchRanger)
This PR was merged into the 5.0 branch.

Discussion
----------

[Console] Fix "Input" typehints

| Q             | A
| ------------- | ---
| Branch?       | 5.0
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #35385
| License       | MIT

Commits
-------

75dbaf0cc5 Fix #35385: Fix Console typehint
2020-01-20 13:05:39 +01:00
Jérémy Derussé e119aa6c48 [DI] Fix EnvVar not loaded when Loader requires an env var 2020-01-20 11:32:09 +01:00
Yonel Ceruto 9ca872054b Fixed #34713 Move new messages to intl domain when possible 2020-01-19 19:23:22 -05:00
Dmitry Danilson 75dbaf0cc5 Fix #35385: Fix Console typehint 2020-01-19 18:13:19 +07:00
Jan Schädlich d18f5ed851 [FrameworkBundle] Fix small typo in output comment 2020-01-18 08:29:24 +01:00
Craig Duncan ef3bcda5e3 Mysqli doesn't support the named parameters used by PdoStore 2020-01-17 17:27:29 +00:00
Thomas Calvet 6b4147c991 [Yaml] Throw on unquoted exclamation mark 2020-01-17 12:30:02 +01:00
Nicolas Grekas f889c1167f minor #35369 [Filesystem] chown and chgrp should also accept int as owner and group (3.4) (Slamdunk)
This PR was merged into the 3.4 branch.

Discussion
----------

[Filesystem] chown and chgrp should also accept int as owner and group (3.4)

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       |
| License       | MIT
| Doc PR        |

Reference: https://github.com/symfony/symfony/pull/35356#issuecomment-575526299

Commits
-------

6b811e6b4c chown and chgrp should also accept int as owner and group
2020-01-17 12:07:25 +01:00
Filippo Tessarotto 6b811e6b4c chown and chgrp should also accept int as owner and group 2020-01-17 09:50:08 +01:00
Fabien Potencier b493997b71 minor #35340 [Validator] Fix plurals for sr_Latn validation messages (knezmilos13)
This PR was merged into the 3.4 branch.

Discussion
----------

[Validator] Fix plurals for sr_Latn validation messages

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #35276
| License       | MIT

validators.sr_Latn.xlf (Serbian, written with latin script) has wrong plurals for all validation message translations that require them (only two where there should be three). This commit fixes that by adding the missing third plural-translation.

Commits
-------

207cdafd54 [Validator] Fix plurals for sr_Latn (Serbian language written in latin script) validation messages
2020-01-16 10:23:40 +01:00
Robin Chalas 6cc377ff3d bug #35343 [Security] Fix RememberMe with null password (jderusse)
This PR was merged into the 3.4 branch.

Discussion
----------

[Security] Fix RememberMe with null password

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | yes
| Tickets       | NA
| License       | MIT
| Doc PR        | NA

From `UserInterface` the method getPassword may return null, while generateCookieHash requires a string.
This PR changes the signature of the methods to allows null password

Similar to #35335 for branch 3.4

Commits
-------

820eb357c8 Fix RememberMe with null password
2020-01-16 01:14:41 +01:00
Yonel Ceruto 56e79fefa1 Revert "Fixed translations file dumper behavior" 2020-01-15 08:29:06 -05:00
Artem Lopata a7a5885661 Properly handle phpunit arguments for configuration file 2020-01-15 11:50:33 +01:00
Jérémy Derussé 820eb357c8
Fix RememberMe with null password 2020-01-14 22:28:32 +01:00
Jérémy Derussé a7d0d82768
Fix RememberMe with null password 2020-01-14 22:27:30 +01:00
knezmilos13 207cdafd54 [Validator] Fix plurals for sr_Latn (Serbian language written in latin script) validation messages 2020-01-14 19:27:07 +01:00
Nicolas Grekas 759e20e6d3 [String] add missing encoding when calling mb_ord() 2020-01-14 18:54:59 +01:00
Nicolas Grekas 477e843790 bug #34223 [DI] Suggest typed argument when binding fails with untyped argument (gudfar)
This PR was merged into the 4.3 branch.

Discussion
----------

[DI] Suggest typed argument when binding fails with untyped argument

| Q             | A
| ------------- | ---
| Branch?       |  4.3
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       |  #33470
| License       | MIT

I've added a condition that looks for arguments and if the typehint doesn’t match, throws an `InvalidArgumentException`

Commits
-------

0e92399daa [DI] Suggest typed argument when binding fails with untyped argument
2020-01-14 17:43:06 +01:00
Nicolas Grekas be84687263 bug #35323 [FrameworkBundle] Set booted flag to false when test kernel is unset (thiagocordeiro)
This PR was submitted for the 5.0 branch but it was merged into the 4.4 branch instead.

Discussion
----------

[FrameworkBundle] Set booted flag to false when test kernel is unset

| Q             | A
| ------------- | ---
| Branch?       | 5.0
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| License       | MIT

When `KernelTestCase::$kernel` is set to `null` `KernelTestCase::$booted` is not reseted and recreating the client is not possible because it relies on `booted` flag

Commits
-------

6f4684f618 Set booted flag to false when test kernel is unset
2020-01-14 17:26:13 +01:00
Thiago Cordeiro 6f4684f618 Set booted flag to false when test kernel is unset 2020-01-14 17:26:06 +01:00
Nicolas Grekas 6b95ea61a0 minor #35334 [FrameworkBundle] remove messenger cache if not enabled (dmaicher)
This PR was merged into the 4.3 branch.

Discussion
----------

[FrameworkBundle] remove messenger cache if not enabled

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes/no
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -
<!--
Replace this notice by a short README for your feature/bugfix. This will help people
understand your PR and can be used as a start for the documentation.

Additionally (see https://symfony.com/roadmap):
 - Always add tests and ensure they pass.
 - Never break backward compatibility (see https://symfony.com/bc).
 - Bug fixes must be submitted against the lowest maintained branch where they apply
   (lowest branches are regularly merged to upper ones so they get the fixes too.)
 - Features and deprecations must be submitted against branch master.
-->

I noticed on one of my apps that I have a cache pool related to the symfony messenger integration although I'm not using the messenger at all.

```
bin/console debug:container cache.messenger.restart_workers_signal

Information for Service "cache.messenger.restart_workers_signal"
================================================================

 An adapter that collects data about all cache calls.

 ---------------- --------------------------------------------------
  Option           Value
 ---------------- --------------------------------------------------
  Service ID       cache.messenger.restart_workers_signal
  Class            Symfony\Component\Cache\Adapter\TraceableAdapter
  Tags             cache.pool
                   kernel.reset (method: reset)
  Public           no
  Synthetic        no
  Lazy             no
  Shared           yes
  Abstract         no
  Autowired        no
  Autoconfigured   no
 ---------------- -----------------------------------------
```

So this PR removes the definition of the service in case the messenger integration is disabled.

Commits
-------

f81161df8d [FrameworkBundle] remove messenger cache if not enabled
2020-01-14 17:22:33 +01:00
David Maicher f81161df8d [FrameworkBundle] remove messenger cache if not enabled 2020-01-14 15:28:35 +01:00
Thomas Calvet fb48bbc05b [PhpUnitBridge][SymfonyTestsListenerTrait] Remove some unneeded code 2020-01-14 15:27:59 +01:00
Nicolas Grekas ec0333c081 bug #35324 [HttpClient] Fix strict parsing of response status codes (Armando-Walmeric)
This PR was submitted for the master branch but it was squashed and merged into the 4.3 branch instead.

Discussion
----------

[HttpClient] Fix strict parsing of response status codes

| Q             | A
| ------------- | ---
| Branch?       | 5.0
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | No ticket opened
| License       | MIT
| Doc PR        | No new feature

If you wait a strict Http code response by the server were you request, but the server response isn't strict and only return HTTP/1.1 200 we have a problem without sense to be strict on regular expression.

Commits
-------

4aa953600f [HttpClient] Fix strict parsing of response status codes
2020-01-13 18:23:15 +01:00
Armando 4aa953600f [HttpClient] Fix strict parsing of response status codes 2020-01-13 18:23:05 +01:00
Fabien Potencier db3134eba4 bug #35318 [Yaml] fix PHP const mapping keys using the inline notation (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

[Yaml] fix PHP const mapping keys using the inline notation

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #35179
| License       | MIT
| Doc PR        |

Commits
-------

45461c73bf fix PHP const mapping keys using the inline notation
2020-01-13 14:54:16 +01:00
Christian Flothmann 45461c73bf fix PHP const mapping keys using the inline notation 2020-01-13 09:00:59 +01:00
Robin Chalas 642c7ffed8 minor #35314 [SecurityBundle] Drop duplicated code (chalasr)
This PR was merged into the 4.4 branch.

Discussion
----------

[SecurityBundle] Drop duplicated code

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

Commits
-------

ffbf31d8c6 [SecurityBundle] Drop duplicated code
2020-01-12 18:08:56 +01:00
Robin Chalas ffbf31d8c6 [SecurityBundle] Drop duplicated code 2020-01-12 17:20:05 +01:00
Fabien Potencier 8e0f0cc990 bug #35306 [FrameworkBundle] Make sure one can use fragments.hinclude_default_template (Nyholm)
This PR was squashed before being merged into the 4.4 branch (closes #35306).

Discussion
----------

[FrameworkBundle] Make sure one can use fragments.hinclude_default_template

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       |
| License       | MIT
| Doc PR        |

Using `framework.fragments.hinclude_default_template` is not possible in 4.4. You will always get an exception saying:

>  You cannot set both "templating.hinclude_default_template" and "fragments.hinclude_default_template", please only use "fragments.hinclude_default_template".

That is because in [fragment_renderer.xml](https://github.com/symfony/symfony/blob/4.4/src/Symfony/Bundle/FrameworkBundle/Resources/config/fragment_renderer.xml#L8) we define the parameter `fragment.renderer.hinclude.global_template` to be an empty string, then in FrameworkExtension we are checking if it is null.

This PR do a `!empty` check instead. I also added a test to show the bug.

Commits
-------

25fd665d0e [FrameworkBundle] Make sure one can use fragments.hinclude_default_template
2020-01-12 07:57:39 +01:00
Nyholm 25fd665d0e [FrameworkBundle] Make sure one can use fragments.hinclude_default_template 2020-01-12 07:57:34 +01:00
Fabien Potencier 764c91bd9f bug #35304 [HttpKernel] Fix that no-cache MUST revalidate with the origin (mpdude)
This PR was merged into the 3.4 branch.

Discussion
----------

[HttpKernel] Fix that no-cache MUST revalidate with the origin

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       |
| License       | MIT
| Doc PR        |

From [RFC 7234 Section 5.2.2](https://tools.ietf.org/html/rfc7234#section-5.2.2)

> The "no-cache" response directive indicates that the response MUST NOT be used to satisfy a subsequent request without successful validation on the origin server.  This allows an origin server to prevent a cache from using it to satisfy a request without contacting it, even by caches that have been configured to send stale responses.

This is unconditional – the response must be revalidated right away.

(`must-revalidate`, to the contrary, requires revalidation only once the response has become stale.)

Commits
-------

c8bdcb3408 Fix that no-cache requires positive validation with the origin, even for fresh responses
2020-01-11 08:35:43 +01:00
Fabien Potencier 7e1a7b753e minor #35297 Improve upgrading instructions for deprecated router options (flack)
This PR was merged into the 4.4 branch.

Discussion
----------

Improve upgrading instructions for deprecated router options

See https://github.com/symfony/symfony/pull/30249#issuecomment-572976926

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | #30249
| License       | MIT
| Doc PR        |

Commits
-------

2cc708341e Improve upgrading instructions for deprecated router options
2020-01-11 08:31:01 +01:00
Matthias Pigulla c8bdcb3408 Fix that no-cache requires positive validation with the origin, even for fresh responses 2020-01-10 22:32:00 +00:00
Robin Chalas b4a63f925f Merge branch '4.4' into 5.0
* 4.4:
  Avoid stale-if-error if kernel.debug = true, because it hides errors
  [Console] Fix SymfonyQuestionHelper tests sometimes failing on AppVeyor
  [SecurityBundle] Fix collecting traceable listeners info using anonymous: lazy
  [Filesystem][FilesystemCommonTrait] Use a dedicated directory when there are no namespace
  [Workflow] Fix configuration node reference for "initial_marking"
  expand listener in place
  [DI] deferred exceptions in ResolveParameterPlaceHoldersPass
  Do not throw exception on valut generate key
2020-01-10 22:57:37 +01:00
Robin Chalas 36e6ceaeb7 Merge branch '4.3' into 4.4
* 4.3:
  Avoid stale-if-error if kernel.debug = true, because it hides errors
  [Console] Fix SymfonyQuestionHelper tests sometimes failing on AppVeyor
  [Workflow] Fix configuration node reference for "initial_marking"
  expand listener in place
  [DI] deferred exceptions in ResolveParameterPlaceHoldersPass
2020-01-10 22:54:01 +01:00
Robin Chalas 1d25a25109 Merge branch '3.4' into 4.3
* 3.4:
  Avoid stale-if-error if kernel.debug = true, because it hides errors
  [Console] Fix SymfonyQuestionHelper tests sometimes failing on AppVeyor
  [DI] deferred exceptions in ResolveParameterPlaceHoldersPass
2020-01-10 22:48:14 +01:00
flack 2cc708341e Improve upgrading instructions for deprecated router options
See https://github.com/symfony/symfony/pull/30249#issuecomment-572976926
2020-01-10 15:12:13 +01:00
Fabien Potencier d079389267 minor #35289 [Workflow] Fix configuration node reference for "initial_marking" (phansys)
This PR was merged into the 4.3 branch.

Discussion
----------

[Workflow] Fix configuration node reference for "initial_marking"

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Related to       | #30890
| License       | MIT

Commits
-------

452f92540b [Workflow] Fix configuration node reference for "initial_marking"
2020-01-10 12:35:58 +01:00
Fabien Potencier a0b976f28a bug #35299 Avoid `stale-if-error` in FrameworkBundle's HttpCache if kernel.debug = true (mpdude)
This PR was merged into the 3.4 branch.

Discussion
----------

Avoid `stale-if-error` in FrameworkBundle's HttpCache if kernel.debug = true

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #24248 (maybe?)
| License       | MIT
| Doc PR        |

When working with the `HttpCache` in development, error messages may not become visible if a `public` response has been successfully generated for the same URL before.

This is because the `HttpCache` from the `HttpKernel` component by default sets `stale_if_error` to 60 seconds.

At least when using the `HttpCache` subclass from the `FrameworkBundle`, we know about the `kernel.debug` setting and its intention to support local development. In that case, we could set the *default* `stale-if-error` value to 0.

Commits
-------

3a23ec89c3 Avoid stale-if-error if kernel.debug = true, because it hides errors
2020-01-10 12:27:06 +01:00
Matthias Pigulla 3a23ec89c3 Avoid stale-if-error if kernel.debug = true, because it hides errors 2020-01-10 10:52:55 +00:00
Fabien Potencier d68a4b0e2e bug #35240 [SecurityBundle] Fix collecting traceable listeners info on lazy firewalls (chalasr)
This PR was merged into the 4.4 branch.

Discussion
----------

[SecurityBundle] Fix collecting traceable listeners info on lazy firewalls

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

Before:
![Screenshot 2020-01-07 at 05 17 47](https://user-images.githubusercontent.com/7502063/71869007-cbffd400-3110-11ea-86ad-234da28621c4.png)

After:
![Screenshot 2020-01-07 at 05 18 12](https://user-images.githubusercontent.com/7502063/71869014-d9b55980-3110-11ea-8efc-1f1b16b2c372.png)

Commits
-------

a3a9a0e30a [SecurityBundle] Fix collecting traceable listeners info using anonymous: lazy
2020-01-10 10:12:52 +01:00
Fabien Potencier d1e31a4fe0 bug #35151 [DI] deferred exceptions in ResolveParameterPlaceHoldersPass (Islam93)
This PR was merged into the 3.4 branch.

Discussion
----------

[DI] deferred exceptions in ResolveParameterPlaceHoldersPass

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #30428
| License       | MIT
| Doc PR        | n/a

fixes case #30428
implemented as in AutowiringPass

Commits
-------

b3a2173c8e [DI] deferred exceptions in ResolveParameterPlaceHoldersPass
2020-01-10 09:08:19 +01:00
Fabien Potencier b0e11e80bc bug #35290 [Filesystem][FilesystemCommonTrait] Use a dedicated directory when there are no namespace (fancyweb)
This PR was merged into the 4.4 branch.

Discussion
----------

[Filesystem][FilesystemCommonTrait] Use a dedicated directory when there are no namespace

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

This PR fixes the following edge case:
- you use a namespaced filesystem adapter with root dir `/foo` and namespace `a`: all files are written in `/foo/a` (eg: it will write `/foo/a/b/file`)
- you use another filesystem adapter with the same root dir but without namespace and you clear it.
- it will fail because it will try to delete the `/foo/a/b` directory (see https://github.com/symfony/symfony/pull/33921 new `scanHashDir()` method - `a` is a possible dir value (see `getFile()`) so we look for it).

The simple solution (suggested by @nicolas-grekas) is to put the "empty namespace" in a dedicated directory.

Bonus: that will fix the tests that currently always fail on AppVeyor. The file in the namespace `a` is a leftover from a previous test. Without this patch, I have the same fail on my Mac. I did not look why it currently passes on travis.

Commits
-------

eaa767bebd [Filesystem][FilesystemCommonTrait] Use a dedicated directory when there are no namespace
2020-01-10 09:04:21 +01:00