Commit Graph

49381 Commits

Author SHA1 Message Date
Tobias Schultze
2d781ddce6 fix test checking non-existing arg 2020-06-11 23:52:31 +02:00
Tobias Schultze
551f7cfa8d Merge branch '5.0' into 5.1 2020-06-11 23:20:02 +02:00
Tobias Schultze
c704acbf9b Merge branch '4.4' into 5.0 2020-06-11 23:19:34 +02:00
Fabien Potencier
51be09c13c minor #37214 Remove non-existing arg and param from serializer service config (Tobion)
This PR was merged into the 4.4 branch.

Discussion
----------

Remove non-existing arg and param from serializer service config

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

Leftover from #22741

Commits
-------

d179d71f45 Remove non-existing arg and param from serializer service config
2020-06-11 16:32:27 +02:00
Fabien Potencier
816b6ea6f1 Fix typo 2020-06-11 15:00:25 +02:00
Fabien Potencier
54c9054ef4 bug #37182 [HttpKernel] Fix regression where Store does not return response body correctly (mpdude)
This PR was squashed before being merged into the 3.4 branch.

Discussion
----------

[HttpKernel] Fix regression where Store does not return response body correctly

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

Since #36833, the `Store` no longer uses or trusts the `X-Content-Digest` header present on a response, since that may come (in the case of using `CachingHttpClient`) from upstream HTTP sources. Instead, the `X-Content-Digest` is re-computed every time a response is written by the `Store`.

Additionally, the `Store` is implemented in a way that when restoring responses, it does _not_ actually load the response body, but just keeps the file path to the content on disk in another internal header called `X-Body-File`. It is up to others (`HttpCache`, for example) to actually load the content from there. For reasons I could not determine, the file path is also set as the response body.

When the `HttpCache` performs revalidations, it may happen that it wants the `Store` to persist a previously restored response. In that case, the `Store` fails to honor its own `X-Body-File` header. Instead, it would compute (since #36833) the `X-Content-Digest`, which now is a hash of the cache file path.

So, we end up with a response that still carries `X-Body-File` for the original, correct response. Since the `HttpCache` honors this value, we don't immediately notice that. But inside the `Store`, the request is now associated with the _new_ (bogus) content entry.

It takes another round of looking up the content in the `Store` to now get a response where the `X-Body-File` _also_ points to the wrong content entry.

Although I feel a bit uncomfortable with trusting headers that seemingly need to be evaluated in different classes and may come from elsewhere, my suggestion is to skip the write inside `Store` if `X-Body-File` and `X-Content-Digest` are both present and consistent with each other.

Additionally, a `file_exists` check could be added to provide additional assertions, at the cost of accessing the filesystem.

Commits
-------

176e769e5f [HttpKernel] Fix regression where Store does not return response body correctly
2020-06-11 14:59:43 +02:00
Matthias Pigulla
176e769e5f [HttpKernel] Fix regression where Store does not return response body correctly 2020-06-11 14:59:37 +02:00
Fabien Potencier
b1f2a1409c bug #37193 [DependencyInjection][CheckTypeDeclarationsPass] Always resolve parameters (fancyweb)
This PR was merged into the 4.4 branch.

Discussion
----------

[DependencyInjection][CheckTypeDeclarationsPass] Always resolve parameters

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | https://github.com/symfony/symfony/issues/37166
| License       | MIT
| Doc PR        | -

> Only array parameters are not inlined when dumped.

This is true only when the XML debug container is used, not on a live container that can contain unresolved parameters in the `%my_param%` form. That was my mistake. We have to resolve to get the parameter type.

`$value = [];` was just an improvement to avoid useless parameter resolve btw.

Commits
-------

da0e2c36ef [DependencyInjection][CheckTypeDeclarationsPass] Always resolve parameters
2020-06-11 14:58:51 +02:00
Fabien Potencier
faafec4a04 bug #37044 [DependencyInjection] Apply ExpressionLanguageProviderPass to router.default (wizhippo)
This PR was squashed before being merged into the 5.1 branch.

Discussion
----------

[DependencyInjection] Apply ExpressionLanguageProviderPass to router.default

| Q             | A
| ------------- | ---
| Branch?       |  5.1
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix https://github.com/symfony/symfony/issues/37042
| License       | MIT

Using a `chain_router` usually replaces the `router` and add the `router.default` to it's chain.

This would `addExpressionLanguageProvider` to the default router only as the chain router is not expected to have `addExpressionLanguageProvider` as it is not part of the router interface.

Commits
-------

215ad1f93d [DependencyInjection] Apply ExpressionLanguageProviderPass to router.default
2020-06-11 14:57:51 +02:00
Douglas Hammond
215ad1f93d [DependencyInjection] Apply ExpressionLanguageProviderPass to router.default 2020-06-11 14:57:45 +02:00
Tobias Schultze
d179d71f45 Remove non-existing arg and param from serializer service config 2020-06-11 14:32:28 +02:00
Nicolas Grekas
69c37c0335 bug #37054 [String] Fix ellipsis of truncate when not using cut option (DuboisS)
This PR was merged into the 5.1 branch.

Discussion
----------

[String] Fix ellipsis of truncate when not using cut option

| Q             | A
| ------------- | ---
| Branch?       | 5.1 <!-- see below -->
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | - <!-- prefix each issue number with "Fix #", if any -->
| License       | MIT
| Doc PR        | - <!-- required for new features -->

[Since 5.1](https://symfony.com/blog/new-in-symfony-5-1-string-improvements#keep-the-last-word-when-truncating), we can use a cut option on truncate.
But with this option, we don't have the expected behavior when the entire chain is returned.

Currently:
`u('Lorem Ipsum')->truncate(8, '…', false); // 'Lorem Ipsum...'`
Instead of:
`u('Lorem Ipsum')->truncate(8, '…', false); // 'Lorem Ipsum'`

Thanks to @jmsche for his help.

Commits
-------

a2ee6c6cf4 [String] Fix ellipsis of truncate when not using cut option
2020-06-11 14:17:23 +02:00
Steven Dubois
a2ee6c6cf4 [String] Fix ellipsis of truncate when not using cut option 2020-06-11 14:16:36 +02:00
Fabien Potencier
816958176c bug #37190 [HttpClient] disable AMP's inactivity timeout, we deal with it on our own already (nicolas-grekas)
This PR was merged into the 5.1 branch.

Discussion
----------

[HttpClient] disable AMP's inactivity timeout, we deal with it on our own already

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

I encountered this today also.

Commits
-------

a7b18ff590 [HttpClient] disable AMP's inactivity timeout, we deal with it on our own already
2020-06-11 08:14:20 +02:00
Fabien Potencier
7107080675 bug #37191 [HttpClient] fix offset computation for data chunks (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpClient] fix offset computation for data chunks

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

A minor thingy, still a bugfix.

Commits
-------

ff05be06ec [HttpClient] fix offset computation for data chunks
2020-06-11 08:13:02 +02:00
Thomas Calvet
da0e2c36ef [DependencyInjection][CheckTypeDeclarationsPass] Always resolve parameters 2020-06-10 18:12:11 +02:00
Nicolas Grekas
ff05be06ec [HttpClient] fix offset computation for data chunks 2020-06-10 17:33:47 +02:00
Nicolas Grekas
a7b18ff590 [HttpClient] disable AMP's inactivity timeout, we deal with it on our own already 2020-06-10 17:30:04 +02:00
Fabien Potencier
7c892eedba bug #37176 [Routing] Keeping routes priorities after add a name prefix to the collection (yceruto)
This PR was merged into the 5.1 branch.

Discussion
----------

[Routing] Keeping routes priorities after add a name prefix to the collection

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

Commits
-------

10105267b5 kept routes priorities after add a name prefix to the collection
2020-06-10 16:21:57 +02:00
Fabien Potencier
292be5fda8 bug #37140 [Lock] Fixed reading locks from replica set secondary nodes (kralos)
This PR was squashed before being merged into the 5.1 branch.

Discussion
----------

[Lock] Fixed reading locks from replica set secondary nodes

| Q             | A
| ------------- | ---
| Branch?       | 5.1
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #37139
| License       | MIT
| Doc PR        | https://github.com/symfony/symfony-docs/pull/13775

Force lock existence query to use `readPreference=primary` in case the given mongo connection is using any of the following `readPreference`s:

* primaryPreferred
* secondary
* secondaryPreferred
* nearest

Any of the above would fail if a secondary node is queried during a lock release.

Commits
-------

ebf7eaf503 [Lock] Fixed reading locks from replica set secondary nodes
2020-06-10 16:19:12 +02:00
Joe Bennett
ebf7eaf503 [Lock] Fixed reading locks from replica set secondary nodes 2020-06-10 16:18:57 +02:00
Yonel Ceruto
10105267b5 kept routes priorities after add a name prefix to the collection 2020-06-10 07:49:58 -04:00
Robin Chalas
c70241e3d2 bug #37177 [Ldap] fix refreshUser() ignoring extra_fields (arkste)
This PR was squashed before being merged into the 4.4 branch (closes #37177).

Discussion
----------

[Ldap] fix refreshUser() ignoring extra_fields

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

While #31532 introduced `extra_fields` in general, #32824 later added `LdapUser` & `LdapUserProvider` and ignored `extra_fields` on `refreshUser()`.

This PR fixes `refreshUser()` and adds a test which makes sure, that the refreshed ldap user doesn't lose its default values.

Commits
-------

cb8f12996c [Ldap] fix refreshUser() ignoring extra_fields
2020-06-10 10:37:06 +02:00
Arkadius Stefanski
cb8f12996c [Ldap] fix refreshUser() ignoring extra_fields 2020-06-10 10:36:58 +02:00
Fabien Potencier
5edbf0ba17 bug #37181 [Mailer] Remove an internal annot (fabpot)
This PR was merged into the 4.4 branch.

Discussion
----------

[Mailer] Remove an internal annot

| Q             | A
| ------------- | ---
| Branch?       | 4.4 <!-- see below -->
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | Fix #36699 <!-- prefix each issue number with "Fix #", if any -->
| License       | MIT
| Doc PR        | n/a

There is no reason to mark this method as being internal. Let's remove it.

Commits
-------

52161f35c7 [Mailer] Remove an internal annot
2020-06-10 10:29:57 +02:00
Fabien Potencier
52161f35c7 [Mailer] Remove an internal annot 2020-06-10 07:55:43 +02:00
Fabien Potencier
f87c993c5c bug #36913 [FrameworkBundle] fix type annotation on ControllerTrait::addFlash() (ThomasLandauer)
This PR was merged into the 3.4 branch.

Discussion
----------

[FrameworkBundle] fix type annotation on ControllerTrait::addFlash()

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #28991 Fix #34645
| License       | MIT
| Doc PR        | not yet, see below

Removing `string` type-hint of $message at addFlash()

Closes https://github.com/symfony/symfony/issues/28991 and https://github.com/symfony/symfony/issues/34645

Reasons:

* `addFlash()` is just a convenience shortcut for `FlashBagInterface::add()` which doesn't have the type hint: https://github.com/symfony/symfony/blob/master/src/Symfony/Component/HttpFoundation/Session/Flash/FlashBagInterface.php#L28 . So removing it here improves consistency.

* https://github.com/symfony/symfony/issues/28991#issuecomment-436755949 is a valid use case for having an object as `$message`.

* Twig doesn't have any rendering helpers for the `message`, see https://symfony.com/doc/current/controller.html#flash-messages . And since users have to take care of displaying the `message` themselves, there's no reason to force a string upon them.

* This isn't a real new feature, but it isn't a bugfix either ;-)
* I didn't update `src/**/CHANGELOG.md` yet.
* I'm not sure if it's necessary to update the docs. Maybe a short note https://symfony.com/doc/current/controller.html#flash-messages ?

Commits
-------

dfb4614541 Update AbstractController.php
2020-06-10 03:56:08 +02:00
Fabien Potencier
5cefcc276a bug #37153 [PhpUnitBridge] Fix ExpectDeprecationTrait::expectDeprecation() conflict (fancyweb)
This PR was merged into the 5.1 branch.

Discussion
----------

[PhpUnitBridge] Fix ExpectDeprecationTrait::expectDeprecation() conflict

| Q             | A
| ------------- | ---
| Branch?       | 5.1
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | https://github.com/symfony/symfony/issues/37133
| License       | MIT
| Doc PR        | -

ExpectDeprecationTrait::expectDeprecation() must be compatible with TestCase::expectDeprecation(). I'm personally against a renaming on our side because this name is the best.

Commits
-------

ea5bb242fd [PhpUnitBridge] Fix ExpectDeprecationTrait::expectDeprecation() conflict
2020-06-10 03:44:33 +02:00
Fabien Potencier
f88570af2f bug #37162 [Mailer] added the reply-to addresses to the API SES transport request. (ribeiropaulor)
This PR was merged into the 4.4 branch.

Discussion
----------

[Mailer] added the reply-to addresses to the API SES transport request.

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

The transport was not sending the reply-to addresses to the SES API when using SendEmail API method.

Commits
-------

ee752f90ed [Mailer] added the reply-to addresses to the API SES transport request.
2020-06-10 03:24:15 +02:00
Paulo Ribeiro
ee752f90ed [Mailer] added the reply-to addresses to the API SES transport request.
The transport was not sending the reply-to addresses to the SES API.
2020-06-10 03:24:02 +02:00
Nicolas Grekas
6d6d989dbe bug #37144 [DI] Add check around class_alias for generated proxy classes (enumag)
This PR was merged into the 5.1 branch.

Discussion
----------

[DI] Add check around class_alias for generated proxy classes

| Q             | A
| ------------- | ---
| Branch?       | 5.1
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | nofiles -->
| Tickets       | Fix #37059
| License       | MIT
| Doc PR        |

Here is the [requested](https://github.com/symfony/symfony/issues/37059#issuecomment-638633262) fix.

I'd like to note that I consider this kind of a workaround. I don't know why the issue only started to appear with Symfony 5.1 and not before. There might be some other problem hidden somewhere else.

Commits
-------

c8b7459115 Add class_alias for generated proxy classes
2020-06-09 18:10:54 +02:00
Nicolas Grekas
9e1a8f0c1e minor #37145 [HttpClient] improve monitoring of timeouts with AmpHttpClient (nicolas-grekas)
This PR was merged into the 5.1 branch.

Discussion
----------

[HttpClient] improve monitoring of timeouts with AmpHttpClient

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

Replaces https://github.com/symfony/symfony/pull/36960

Commits
-------

548818d7e9 [HttpClient] improve monitoring of timeouts with AmpHttpClient
2020-06-09 18:10:22 +02:00
Nicolas Grekas
548818d7e9 [HttpClient] improve monitoring of timeouts with AmpHttpClient 2020-06-09 17:53:13 +02:00
Fabien Potencier
d08db0f3f5 Merge branch '5.0' into 5.1
* 5.0:
  [Mime] use fromString when creating a new Adress
2020-06-09 17:07:35 +02:00
Fabien Potencier
748854bad1 Merge branch '4.4' into 5.0
* 4.4:
  [Mime] use fromString when creating a new Adress
2020-06-09 17:07:20 +02:00
Fabien Potencier
5b719d1ee4 bug #37167 [Mime] use fromString when creating a new Address (fabpot)
This PR was merged into the 4.4 branch.

Discussion
----------

[Mime] use fromString when creating a new Address

| Q             | A
| ------------- | ---
| Branch?       | 4.4 <!-- see below -->
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | n/a <!-- prefix each issue number with "Fix #", if any -->
| License       | MIT
| Doc PR        | n/a

When creating an Address, there are two ways right now in 4.4: `Address::create()` which takes an email or an instance of Address and `Address::fromString()` which takes an email or an email+name.

In 4.4, I propose to make `create` supports everything possible. And in 5.2, I will probably propose to deprecate `fromString()`.

Commits
-------

de68787693 [Mime] use fromString when creating a new Adress
2020-06-09 17:06:27 +02:00
Fabien Potencier
b1f19c4027 minor #37104 [Form] rework form validator tests (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

[Form] rework form validator tests

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

This will allow writing tests for #37103.

Commits
-------

f062e08f4d rework form validator tests
2020-06-09 17:03:24 +02:00
Christian Flothmann
f062e08f4d rework form validator tests 2020-06-09 16:48:06 +02:00
Nicolas Grekas
7da0ffd062 Merge branch '5.0' into 5.1
* 5.0:
  [Messenger] fix typo
2020-06-09 16:24:29 +02:00
Nicolas Grekas
bd4a238fb2 Merge branch '4.4' into 5.0
* 4.4:
  [Messenger] fix typo
2020-06-09 16:23:46 +02:00
Nicolas Grekas
749380a399 [Messenger] fix typo 2020-06-09 16:23:13 +02:00
Nicolas Grekas
374e23b967 Merge branch '5.0' into 5.1
* 5.0:
  Correctly use doctrine/dbal v3+
  Correctly use doctrine/dbal v3+
2020-06-09 16:15:34 +02:00
Nicolas Grekas
9bfe5065b7 Merge branch '4.4' into 5.0
* 4.4:
  Correctly use doctrine/dbal v3+
  Correctly use doctrine/dbal v3+
2020-06-09 16:10:15 +02:00
Nicolas Grekas
2ebb63a883 Merge branch '3.4' into 4.4
* 3.4:
  Correctly use doctrine/dbal v3+
2020-06-09 16:07:49 +02:00
Nicolas Grekas
909931d9a4 Correctly use doctrine/dbal v3+ 2020-06-09 16:07:03 +02:00
Nicolas Grekas
4a51827b6d Correctly use doctrine/dbal v3+ 2020-06-09 16:02:17 +02:00
Nicolas Grekas
d5ff9e7d81 Merge branch '5.0' into 5.1
* 5.0:
  [Cache] fix parse error on PHP 5.5
  [Cache] fix compat with doctrine/dbal v3
  [Lock] fix compat with doctrine/dbal v3
2020-06-09 14:11:32 +02:00
Nicolas Grekas
d0a11c7911 Merge branch '4.4' into 5.0
* 4.4:
  [Cache] fix parse error on PHP 5.5
2020-06-09 14:09:45 +02:00
Nicolas Grekas
e1050c9373 Merge branch '3.4' into 4.4
* 3.4:
  [Cache] fix parse error on PHP 5.5
2020-06-09 14:08:55 +02:00
Nicolas Grekas
ef6fc09260 [Cache] fix parse error on PHP 5.5 2020-06-09 14:06:18 +02:00