Commit Graph

43656 Commits

Author SHA1 Message Date
Nicolas Grekas
15f08553be [OptionsResolve] Revert change in tests for a not-merged change in code 2019-10-28 18:16:45 +01:00
Nicolas Grekas
6d5c91bb47 Merge branch '3.4' into 4.3
* 3.4:
  #30432 fix an error message
  fix paths to detect code owners
  [Validator] Ensure numeric subpaths do not cause errors on PHP 7.4
  Remove unused local variables in tests
  Make sure to collect child forms created on *_SET_DATA events
  do not render errors for checkboxes twice
2019-10-28 18:07:32 +01:00
Nicolas Grekas
48533ff3f1 bug #34152 [Workflow] Made the configuration more robust for the 'property' key (lyrixx)
This PR was merged into the 4.3 branch.

Discussion
----------

[Workflow] Made the configuration more robust for the 'property' key

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #34092
| License       | MIT
| Doc PR        |

Commits
-------

0c31ff007e [Workflow] Made the configuration more robust for the 'property' key
2019-10-28 17:55:19 +01:00
Nicolas Grekas
fd5b8def49 bug #34154 [HttpClient] fix handling of 3xx with no Location header - ignore Content-Length when no body is expected (nicolas-grekas)
This PR was merged into the 4.3 branch.

Discussion
----------

[HttpClient] fix handling of 3xx with no Location header - ignore Content-Length when no body is expected

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

A `304` is the final response code.
This PR implements the same logic as curl.

Commits
-------

50a88c59f6 [HttpClient] fix handling of 3xx with no Location header - ignore Content-Length when no body is expected
2019-10-28 17:53:30 +01:00
Nicolas Grekas
50a88c59f6 [HttpClient] fix handling of 3xx with no Location header - ignore Content-Length when no body is expected 2019-10-28 16:45:56 +01:00
Grégoire Pineau
0c31ff007e [Workflow] Made the configuration more robust for the 'property' key 2019-10-28 15:45:57 +01:00
Robin Chalas
3be177a93f bug #34140 [Security/Core] make NativePasswordEncoder use sodium to validate passwords when possible (nicolas-grekas)
This PR was merged into the 4.3 branch.

Discussion
----------

[Security/Core] make NativePasswordEncoder use sodium to validate passwords when possible

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

sodium implementations are always faster, let's use them when possible. This also allows validating argon2 passwords when bcrypt is configured as the main one, making migrations possible.

Commits
-------

799a2eae2d [Security/Core] make NativePasswordEncoder use sodium to validate passwords when possible
2019-10-28 10:35:50 +01:00
Nicolas Grekas
799a2eae2d [Security/Core] make NativePasswordEncoder use sodium to validate passwords when possible 2019-10-28 10:20:18 +01:00
Fabien Potencier
8920672b2e minor #34127 fix paths to detect code owners (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

fix paths to detect code owners

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

I was wondering why sometimes I didn't receive any notifications for PRs where I thought a file for which I claimed code ownership was modified. Turns out according to https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners#codeowners-syntax the `dir/*` pattern does not include nested directories.

Commits
-------

cb7523d595 fix paths to detect code owners
2019-10-26 21:54:01 +02:00
Yonel Ceruto
fb70e0af8d minor #30442 [OptionsResolver] Fix an error message to be more accurate (dimabory)
This PR was merged into the 3.4 branch.

Discussion
----------

[OptionsResolver] Fix an error message to be more accurate

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

See #30432 for more details:
> **Symfony version(s) affected**: 3.4, maybe other versions too (not tested)
>
> **Description**
> Error message when allowedTypes is an array contains `[]` but should not:
> `The option "testme" with value array is expected to be of type "string[]", but one of the elements is of type "integer[]".`
> It should be:
> `The option "testme" with value array is expected to be of type "string[]", but one of the elements is of type "integer".`
>
> **How to reproduce**
>
> ```
> $resolver = (new OptionsResolver())
>     ->setDefault('testme', [])
>     ->setAllowedTypes('testme', ['string[]'])
>     ->resolve(['testme' => ['test', 12]]);
> ```

In addition I changed an error message to be more
accurate if provided more than one incorrect value:
> [...] is expected to be of type "integer[][]", but is of type "integer|boolean|string".

Commits
-------

7fa2fc2 #30432 fix an error message
2019-10-26 07:18:38 -04:00
Dmytro
7fa2fc2b96 #30432 fix an error message 2019-10-26 07:02:01 -04:00
Yonel Ceruto
2a5c75582e bug #33999 [Form] Make sure to collect child forms created on *_SET_DATA events (yceruto)
This PR was merged into the 3.4 branch.

Discussion
----------

[Form] Make sure to collect child forms created on *_SET_DATA events

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

See reproducer provided by @WubbleWobble https://github.com/WubbleWobble/symfony-issue-29291.

Commits
-------

50efc1a Make sure to collect child forms created on *_SET_DATA events
2019-10-26 06:32:38 -04:00
Christian Flothmann
cb7523d595 fix paths to detect code owners 2019-10-26 10:25:32 +02:00
Fabien Potencier
591ad2203c bug #34090 [WebProfilerBundle] Improve display in Email panel for dark theme (antograssiot)
This PR was merged into the 4.3 branch.

Discussion
----------

[WebProfilerBundle] Improve display in Email panel for dark theme

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

Improve the email panel readability when using dark theme

## before
<img width="496" alt="Capture d’écran 2019-10-23 à 19 54 59" src="https://user-images.githubusercontent.com/4977112/67420667-5d11e500-f5cf-11e9-91c6-75d2f55a32e7.png">

## after
<img width="492" alt="Capture d’écran 2019-10-23 à 19 53 26" src="https://user-images.githubusercontent.com/4977112/67420679-626f2f80-f5cf-11e9-8762-ad56978c1ac8.png">

Commits
-------

402fed02e7 [WebProfilerBundle] Improve display in Email panel for dark theme
2019-10-26 10:23:07 +02:00
Christian Flothmann
ccc5667df8 minor #34100 [Yaml][Parser] Remove the getLastLineNumberBeforeDeprecation() internal unused method (fancyweb)
This PR was merged into the 4.3 branch.

Discussion
----------

[Yaml][Parser] Remove the getLastLineNumberBeforeDeprecation() internal unused method

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

This method is internal and unused. It was removed by a2ae6bf745 but was added back mistakenly by 1baac5a74f.

Commits
-------

49acc16424 [Yaml][Parser] Remove the getLastLineNumberBeforeDeprecation() internal unused method
2019-10-26 09:13:46 +02:00
Christian Flothmann
48d189b46b minor #34112 [SecurityBundle] Fix wrong assertion (chalasr)
This PR was merged into the 4.3 branch.

Discussion
----------

[SecurityBundle] Fix wrong assertion

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

Commits
-------

8e56f46150 [SecurityBundle] Fix wrong assertion
2019-10-26 09:11:52 +02:00
Fabien Potencier
6c08ac599e bug #34116 [HttpClient] ignore the body of responses to HEAD requests (nicolas-grekas)
This PR was merged into the 4.3 branch.

Discussion
----------

[HttpClient] ignore the body of responses to HEAD requests

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

Commits
-------

0fc371e7df [HttpClient] ignore the body of responses to HEAD requests
2019-10-25 15:21:40 +02:00
Nicolas Grekas
0fc371e7df [HttpClient] ignore the body of responses to HEAD requests 2019-10-25 15:08:37 +02:00
Tobias Schultze
c953ba88d7 minor #34097 [Validator] Ensure numeric subpaths do not cause errors on PHP 7.4 (alexpott)
This PR was squashed before being merged into the 3.4 branch (closes #34097).

Discussion
----------

[Validator] Ensure numeric subpaths do not cause errors on PHP 7.4

| Q             | A
| ------------- | ---
| Branch?       | 3.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       | Fix #... <!-- prefix each issue number with "Fix #", if any -->
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

Drupal is testing on PHP7.4 and hitting a problem with the line `if ('[' === $subPath[0]) {` because `$subPath` is not a string. We're already doing string casting in the method so we could do it once and be done. Note this is not a problem on the master branch / SF5 because of primitive typehinting.

Without this fix on PHP7.4 you see errors like...
```
1) Symfony\Component\Validator\Tests\Util\PropertyPathTest::testAppend with data set #5 ('0', 1, '0.1', 'Numeric subpaths do not cause...rrors.')
Trying to access array offset on value of type int
```

Commits
-------

6244a1ec47 [Validator] Ensure numeric subpaths do not cause errors on PHP 7.4
2019-10-25 15:07:00 +02:00
Alex Pott
6244a1ec47 [Validator] Ensure numeric subpaths do not cause errors on PHP 7.4 2019-10-25 15:06:49 +02:00
Tobias Schultze
8bf8c50363 bug #32456 [Messenger] use database platform to convert correctly the DateTime (roukmoute)
This PR was merged into the 4.3 branch.

Discussion
----------

[Messenger] use database platform to convert correctly the DateTime

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | yes <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes
| Fixed tickets | https://github.com/symfony/symfony/issues/32427
| License       | MIT

In Doctrine Messenger the method `\Symfony\Component\Messenger\Transport\Doctrine\Connection::formatDateTime()` is used to format dateTime into this: `Y-m-d\TH:i:s`.
But this is not supported in all databases platform.

Here we use the database platform to convert correctly the dateTime.

Commits
-------

cfa11561d1 Format DateTime depending on database platform
2019-10-25 12:57:14 +02:00
Tobias Schultze
13853d575d bug #34107 [Messenger] prevent infinite redelivery loops and blocked queues (Tobion)
This PR was merged into the 4.3 branch.

Discussion
----------

[Messenger] prevent infinite redelivery loops and blocked queues

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| 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 #32055
| License       | MIT
| Doc PR        |

This PR solves a very common fitfall of amqp redeliveries. It's for example explained in https://blog.forma-pro.com/rabbitmq-redelivery-pitfalls-440e0347f4e0
Newer RabbitMQ versions provide a solution for this by itself but only for quorum queues and not the classic ones, see https://github.com/rabbitmq/rabbitmq-server/pull/1889

This PR adds a middleware that throws a RejectRedeliveredMessageException when a message is detected that has been redelivered by AMQP.

The middleware runs before the HandleMessageMiddleware and prevents redelivered messages from being handled directly. The thrown exception is caught by the worker and will trigger the retry logic according to the retry strategy.

AMQP redelivers messages when they do not get acknowledged or rejected. This can happen when the connection times out or an exception is thrown before acknowledging or rejecting. When such errors happen again while handling the redelivered message, the message would get redelivered again and again. The purpose of this middleware is to prevent infinite redelivery loops and to unblock the queue by republishing the redelivered messages as retries with a retry limit and potential delay.

Commits
-------

d211904c8e [Messenger] prevent infinite redelivery loops and blocked queues
2019-10-25 12:52:06 +02:00
Robin Chalas
8e56f46150 [SecurityBundle] Fix wrong assertion 2019-10-25 10:35:42 +02:00
Mathias STRASSER
cfa11561d1
Format DateTime depending on database platform 2019-10-25 10:13:54 +02:00
Tobias Schultze
278280a246 minor #34105 Remove unused local variables (fancyweb)
This PR was merged into the 3.4 branch.

Discussion
----------

Remove unused local variables

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

This PR removes useless assignations. There are also somes fixes in tests.

Commits
-------

c07cee8f61 Remove unused local variables in tests
2019-10-25 04:33:49 +02:00
Tobias Schultze
d211904c8e [Messenger] prevent infinite redelivery loops and blocked queues
by republishing the redelivered messages as retries with a retry limit and potential delay
2019-10-24 18:35:41 +02:00
Thomas Calvet
c07cee8f61 Remove unused local variables in tests 2019-10-24 17:33:53 +02:00
Thomas Calvet
49acc16424 [Yaml][Parser] Remove the getLastLineNumberBeforeDeprecation() internal unused method 2019-10-24 12:09:03 +02:00
Yonel Ceruto
50efc1a923 Make sure to collect child forms created on *_SET_DATA events 2019-10-23 15:46:41 -04:00
Anto
402fed02e7
[WebProfilerBundle] Improve display in Email panel for dark theme 2019-10-23 19:52:52 +02:00
Tobias Schultze
b9f69441c5 bug #32341 [Messenger] Show exceptions after multiple retries (TimoBakx)
This PR was merged into the 4.3 branch.

Discussion
----------

[Messenger] Show exceptions after multiple retries

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

After retrying a failed message, the `RedeliveryStamp` looses it's exception information. This PR will remedy that.

Commits
-------

598bd92313 [Messenger] Show exceptions on after empty fails
2019-10-23 16:09:27 +02:00
Timo Bakx
598bd92313 [Messenger] Show exceptions on after empty fails 2019-10-23 15:04:40 +02:00
Tobias Schultze
2e17488332 bug #34082 Revert "[Messenger] Fix exception message of failed message is dropped (Tobion)
This PR was merged into the 4.3 branch.

Discussion
----------

Revert "[Messenger] Fix exception message of failed message is dropped

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

This reverts #33600 because it makes the message grow for each retry until AMQP cannot handle it anymore. On each retry, the full exception trace is added to the message. So in our case on the 5th retry, the message is too big for the AMQP library to encode it. AMQP extension then throws the exception

> Library error: table too large for buffer

(ref. https://github.com/alanxz/rabbitmq-c/issues/224 and https://github.com/pdezwart/php-amqp/issues/131) when trying to publish the message.

To solve this, I suggest to revert #33600 (this PR) and merge #32341 instead which does not re-add the exception on each failure.

Btw, the above problem causes other problematic side-effects of Symfony messenger. As the new retry message fails to be published with an exception, the old (currently processed message) also does not get removed (acknowledged) from the delay queue. So rabbitmq redelivers the message and the same thing happens forever. This can block the consumers and have a huge toll on your service. That's just another case for https://github.com/symfony/symfony/issues/32055#issuecomment-529630654. I'll try to fix this in another PR.

Commits
-------

3dbe924f47 Revert "[Messenger] Fix exception message of failed message is dropped on retry"
2019-10-23 14:36:36 +02:00
Tobias Schultze
3dbe924f47 Revert "[Messenger] Fix exception message of failed message is dropped on retry"
This reverts commit 8f9f44eb21.
2019-10-23 13:26:24 +02:00
Nicolas Grekas
5da67f9126 minor #34052 [HttpClient] skip tests implemented in 4.4 (nicolas-grekas)
This PR was merged into the 4.3 branch.

Discussion
----------

[HttpClient] skip tests implemented in 4.4

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

Needed after #34051 and #34044

Commits
-------

ae86ab18fa [HttpClient] skip tests implemented in 4.4
2019-10-22 08:53:15 +02:00
Nicolas Grekas
5d097d2eb5 bug #34021 [TwigBridge] do not render errors for checkboxes twice (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

[TwigBridge] do not render errors for checkboxes twice

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

Commits
-------

9eddea97d8 do not render errors for checkboxes twice
2019-10-22 08:41:35 +02:00
Nicolas Grekas
13e15e2112 bug #34017 [Messenger] Fix ignored options in redis transport (chalasr)
This PR was merged into the 4.3 branch.

Discussion
----------

[Messenger] Fix ignored options in redis transport

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

Also fixes redis authentication failure handling (inline with invalid db index handling, borrowed from symfony/cache).
/cc @alexander-schranz

Commits
-------

c83ff94c37 [Messenger] Fix ignored options in redis transport
2019-10-22 08:39:15 +02:00
Nicolas Grekas
afbbea3d1b Merge branch '3.4' into 4.3
* 3.4:
  Fix small typo in Exception message
2019-10-22 08:25:19 +02:00
Nicolas Grekas
ae86ab18fa [HttpClient] skip tests implemented in 4.4 2019-10-21 18:09:12 +02:00
Nicolas Grekas
3644a18012 minor #34049 [Workflow] Fix small typo in Exception message (holtkamp)
This PR was merged into the 3.4 branch.

Discussion
----------

[Workflow] Fix small typo in Exception message

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

Commits
-------

7c2b974e26 Fix small typo in Exception message
2019-10-21 17:45:06 +02:00
Menno Holtkamp
7c2b974e26 Fix small typo in Exception message 2019-10-21 17:42:36 +02:00
Fabien Potencier
5ce78ccbe1 Merge branch '3.4' into 4.3
* 3.4:
  [HttpKernel] fix wrong removal of the just generated container dir
2019-10-20 14:37:59 +02:00
Fabien Potencier
b38bde9cb1 bug #34041 [HttpKernel] fix wrong removal of the just generated container dir (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[HttpKernel] fix wrong removal of the just generated container dir

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

The patch applies to 3.4 but the fix really affects to 4.4 with the introduction of the new `.preload.php` file.

/cc @fabpot since you encountered this error quite often recently during `composer up/req` :)

Commits
-------

4ad09ebafb [HttpKernel] fix wrong removal of the just generated container dir
2019-10-20 14:36:59 +02:00
Nicolas Grekas
4ad09ebafb [HttpKernel] fix wrong removal of the just generated container dir 2019-10-20 12:02:53 +02:00
Nicolas Grekas
568f4b4094 Merge branch '3.4' into 4.3
* 3.4:
  bug #34024 [Routing] fix route loading with wildcard, but dir or file is empty (gseidel)
2019-10-19 15:08:51 +02:00
Nicolas Grekas
a54ecb0fae bug #34024 [Routing] fix route loading with wildcard, but dir or file is empty (gseidel)
This PR was merged into the 4.3 branch.

Discussion
----------

[Routing] fix route loading with wildcard, but dir or file is empty

| Q             | A
| ------------- | ---
| Branch?       |  4.3
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | no ticket i see so far
| License       | MIT

In my route config i have something like:

```yaml
empty_wildcard:
    resource: ../controller/empty_wildcard/*
    prefix: /empty_wildcard
```

But ``empty_wildcard`` is empty or has no route configured.

So i had this error:

``Call to a member function addPrefix() on null``

This PR take care if no route is configured, there will be no error.

Commits
-------

217058b475 [Routing] fix route loading with wildcard, but dir or file is empty
2019-10-19 15:07:56 +02:00
Nicolas Grekas
4bd16d884a bug #34024 [Routing] fix route loading with wildcard, but dir or file is empty (gseidel)
This PR was merged into the 4.3 branch.

Discussion
----------

[Routing] fix route loading with wildcard, but dir or file is empty

| Q             | A
| ------------- | ---
| Branch?       |  4.3
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | no ticket i see so far
| License       | MIT

In my route config i have something like:

```yaml
empty_wildcard:
    resource: ../controller/empty_wildcard/*
    prefix: /empty_wildcard
```

But ``empty_wildcard`` is empty or has no route configured.

So i had this error:

``Call to a member function addPrefix() on null``

This PR take care if no route is configured, there will be no error.

Commits
-------

217058b475 [Routing] fix route loading with wildcard, but dir or file is empty
2019-10-19 15:04:41 +02:00
Gerhard Seidel
217058b475 [Routing] fix route loading with wildcard, but dir or file is empty 2019-10-19 15:03:42 +02:00
Christian Flothmann
9526a2d6eb minor #34039 execute all compatible tests across versions (xabbuh)
This PR was merged into the 4.3 branch.

Discussion
----------

execute all compatible tests across versions

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

Commits
-------

18cc561754 execute all compatible tests across versions
2019-10-19 10:24:54 +02:00
Christian Flothmann
18cc561754 execute all compatible tests across versions 2019-10-19 10:14:32 +02:00