Commit Graph

45269 Commits

Author SHA1 Message Date
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
4a6ec8554e [Messenger] remove nullable max retries 2019-10-24 23:51:16 +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
Nicolas Grekas
c5024bdbd0 feature #34051 [HttpClient] allow option "buffer" to be a stream resource (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpClient] allow option "buffer" to be a stream resource

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

Commits
-------

e87301603e [HttpClient] allow option "buffer" to be a stream resource
2019-10-24 15:27:54 +02:00
Tristan Bessoussa
332ff8811c [Routing][Config] Allow patterns of resources to be excluded from config loading 2019-10-24 13:56:35 +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
Nicolas Grekas
791810a4e1 bug #34081 [Validator] Set Length::$allowEmptyString to false when a NotBlank contraint is defined (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[Validator] Set Length::$allowEmptyString to false when a NotBlank contraint is defined

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

Since #31528, we are told to do this kind of changes to our entities:
```diff
     /**
      * @Assert\NotBlank()
-     * @Assert\Length(min="10")
+     * @Assert\Length(min="10", allowEmptyString=false)
      */
     public $description;
```

But the `NotBlank` already says it - this is just boilerplate. More critically, this also means we cannot write annotations that are compatible with 3.4, 4.4 and 5.0 at the same time, making FC/BC hard.

By setting `Length::$allowEmptyString` to `false` when a `NotBlank` contraint is defined, we fix both issues.

/cc @ogizanagi

Commits
-------

840f7e7d88 [Validator] Set Length::$allowEmptyString to false when a NotBlank contraint is defined
2019-10-23 14:11:54 +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
840f7e7d88 [Validator] Set Length::$allowEmptyString to false when a NotBlank contraint is defined 2019-10-23 12:57:33 +02:00
Douglas Greenshields
6b7044fc01
[SecurityBundle] correct types for default arguments for firewall configs 2019-10-23 10:40:35 +01:00
Nicolas Grekas
bfd308ff4a bug #34078 [FrameworkBundle] Don't reset the test container but the real one instead (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[FrameworkBundle] Don't reset the test container but the real one instead

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

After #31202 and #32056, the tearDown method keeps throwing deprecation notices about "Getting the container from a non-booted kernel". The reason is that resetting the test-container calls `$kernel->getContainer()` while the kernel has been shut down.

This fixes it and a few other glitches found meanwhile.

Commits
-------

8e16143256 [FrameworkBundle] Dont reset the test container but the real one instead
2019-10-23 11:00:45 +02:00
Nicolas Grekas
5d82cf3fca minor #34060 [SecurityBundle] test with doctrine-bundle 2 (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[SecurityBundle] test with doctrine-bundle 2

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

Commits
-------

e3261f4f7f [SecurityBundle] test with doctrine-bundle 2
2019-10-23 10:59:42 +02:00
Nicolas Grekas
8e16143256 [FrameworkBundle] Dont reset the test container but the real one instead 2019-10-23 09:54:59 +02:00
Yonel Ceruto
d91a5a067d Avoid nested exceptions if errors occur when generating file links 2019-10-23 00:12:13 -04:00
Robin Chalas
48282ce80f minor #34075 [ErrorHandler] Import missing classes (yceruto)
This PR was merged into the 4.4 branch.

Discussion
----------

[ErrorHandler] Import missing classes

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

Fix https://github.com/symfony/symfony/pull/33053#discussion_r337830081

Commits
-------

e07a3d7bba Import missing classes
2019-10-23 05:07:00 +02:00
Yonel Ceruto
e07a3d7bba Import missing classes 2019-10-22 22:46:01 -04:00
Fabien Potencier
28c9f48f7e bug #34072 [Debug] remove return types that break FC badly (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[Debug] remove return types that break FC badly

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

The return type on Debug's FlattenException blocks creating a child class that is compatible with both v4.4 and v5.0.
Removing it fixes the issue with no BC break.
Adding `final` on `setPrevious` will allow updating its type hint in v5.0.

Commits
-------

cb5ef6ec18 [Debug] remove return types that break FC badly
2019-10-22 19:09:30 +02:00
Nicolas Grekas
cb5ef6ec18 [Debug] remove return types that break FC badly 2019-10-22 18:54:09 +02:00
Fabien Potencier
f00390ffd7 minor #33963 Add .gitignore to .gitattributes (reedy)
This PR was merged into the 4.4 branch.

Discussion
----------

Add .gitignore to .gitattributes

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

Commits
-------

246c5fdf43 Add .gitignore to .gitattributes
2019-10-22 17:44:54 +02:00
Fabien Potencier
8c5403e2dc bug #34015 [Mailer] Fix typo (fabpot)
This PR was merged into the 4.4 branch.

Discussion
----------

[Mailer] Fix typo

| Q             | A
| ------------- | ---
| Branch?       | 4.4 for features / 3.4 or 4.3 for bug fixes <!-- 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 #34006
| License       | MIT
| Doc PR        | n/a

The XML is different depending on the way we are sending email. So, it's `SendEmailResult` when using the API and `SendRawEmailResult` when using the HTTP class (we are then sending the raw email).

Commits
-------

4bd7cb0368 [Mailer] Fix SES Message Id retrieval
2019-10-22 17:36:06 +02:00
Fabien Potencier
4f9d449885 feature #34028 [ExpressionLanguage][Lexer] Exponential format for number (tigr1991)
This PR was merged into the 4.4 branch.

Discussion
----------

[ExpressionLanguage][Lexer] Exponential format for number

Exponential format has been added for numbers.
Ex: 1.99E+3 === 1990,
Ex: expression (1 + 1.99E+3) = 1991

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

Exponential format has been added for numbers.
Ex: 1.99E+3 === 1990,
Expressions:
0.1e+2 = 10
1e-2 = 0.01
(1 + 1.99E+3) = 1991
and etc...

Commits
-------

430ec32992 [ExpressionLanguage][Lexer] Exponential format for number
2019-10-22 17:29:53 +02:00
Fabien Potencier
2931227cad bug #34034 [Mailer][MailchimpBridge] Don't send address names if empty string (ogizanagi)
This PR was merged into the 4.4 branch.

Discussion
----------

[Mailer][MailchimpBridge] Don't send address names if empty string

| 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       | https://github.com/symfony/symfony/pull/34029#issuecomment-543804450 <!-- prefix each issue number with "Fix #", if any -->
| License       | MIT
| Doc PR        | N/A

Commits
-------

197d1236ee [Mailer][MailchimpBridge] Don't send address names if empty string
2019-10-22 17:26:22 +02:00
Fabien Potencier
effae8a643 bug #34067 Use port 465 for SES SMTP transport (rimas-kudelis)
This PR was merged into the 4.4 branch.

Discussion
----------

Use port 465 for SES SMTP transport

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

Commits
-------

8492e260cb Use port 465 for SES SMTP transport
2019-10-22 17:23:40 +02:00
Fabien Potencier
591c71bb7e bug #34066 [Messenger] Fix worker-only Doctrine middleware from running always (weaverryan)
This PR was merged into the 4.4 branch.

Discussion
----------

[Messenger] Fix worker-only Doctrine middleware from running always

| Q             | A
| ------------- | ---
| Branch?       | 4.4 (or 4.3?, this is a bug fix)
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #32436 Depends on #34069
| License       | MIT
| Doc PR        | not needed

Several Doctrine middleware are only meant to be run in a "worker" context: we want to "ping" the connection, "close" the connection and "clear" the entity manager ONLY when we are receiving messages. Before this PR, it was done always, which causes bad behavior for sync messages (imagine your Doctrine connection being closed in the middle of a controller or see https://github.com/symfony/symfony/pull/31334#issuecomment-544288437).

This fixes that in a pragmatic way: no new system for "worker-only" middleware or anything like that: just make the middleware smart enough to only do their work when a message is being received async.

Commits
-------

290a72917b Fixing issue where worker-only middleware were run in all contexts
2019-10-22 17:22:21 +02:00
Fabien Potencier
eaaabb6011 bug #34070 [ErrorRenderer] FlattenException cannot be final (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[ErrorRenderer] FlattenException cannot be final

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

Making it final forces tight coupling with the implementation as soon as one type-hints for the class.

That's a blocker on making e.g. `EasyAdminBundle` compatible with Symfony 5.

Commits
-------

b125835056 [ErrorRenderer] FlattenException cannot be final
2019-10-22 17:21:28 +02:00
Nicolas Grekas
b125835056 [ErrorRenderer] FlattenException cannot be final 2019-10-22 17:18:31 +02:00
Fabien Potencier
90906c5062 feature #34069 [Messenger] Removing "sync" transport and replacing it with config trick (weaverryan)
This PR was merged into the 4.4 branch.

Discussion
----------

[Messenger] Removing "sync" transport and replacing it with config trick

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no (but removes some hackiness)
| New feature?  | no
| Deprecations? | yes (BC break yes)
| Tickets       | Helps #34066
| License       | MIT
| Doc PR        | not needed

I introduced `SyncTransport` in 4.3 as a way to allow people to, for example, route a message to an `async` transport and then override that to a `sync` transport in the dev environment. The implementation was always a bit of a hack, and makes this one transport behave different than others *and* makes messages routed to this transport behave a *bit* different than sync messages that are simply not routed at all.

Thanks for an idea from Nicolas, this fixes that. Gone are `SyncTransport`. Instead, the `sync://` transport string is still supported, but it's just a "config" trick: messages routed to transports that are "sync" are simply filtered out of the "senders" in the DI extension. Nice & clean.

Commits
-------

3d4e59a10b [Messenger] Removing "sync" transport and replacing it with much nicer config trick
2019-10-22 17:18:03 +02:00
Ryan Weaver
290a72917b Fixing issue where worker-only middleware were run in all contexts 2019-10-22 10:54:25 -04:00
Ryan Weaver
3d4e59a10b [Messenger] Removing "sync" transport and replacing it with much nicer config trick 2019-10-22 10:49:37 -04:00
Rimas Kudelis
8492e260cb Use port 465 for SES SMTP transport
Fixes #34064
2019-10-22 16:29:52 +03:00
Nicolas Grekas
e3261f4f7f [SecurityBundle] test with doctrine-bundle 2 2019-10-22 11:22:01 +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
ec8e34f05e minor #34050 [VarDumper] improve displaying cut closures (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[VarDumper] improve displaying cut closures

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

Minor but still an improvement so 4.4: this change makes closures replaced by `CutStub` be displayed with their signature instead of just the `Closure` label.

Commits
-------

2b0a11de02 [VarDumper] improve displaying cut closures
2019-10-22 08:52:31 +02:00
Nicolas Grekas
ebca10e252 minor #34036 [Lock] Set ReturnType of LockFactory to LockInterface (alexander-schranz)
This PR was merged into the 4.4 branch.

Discussion
----------

[Lock] Set ReturnType of LockFactory to LockInterface

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

LockFactory I think should return a LockInterface and not the Lock class.

/cc @chalasr

Commits
-------

ff1fa57ef2 Set ReturnType of LockFactory to LockInterface
2019-10-22 08:44:12 +02:00
Nicolas Grekas
c86271e750 minor #34027 [EventDispatcher] handle lazy-callable invokable (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[EventDispatcher] handle lazy-callable invokable

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

Extracted from #34013, for consistency mostly.

Commits
-------

9df4c7d32b [EventDispatcher] handle lazy-callable invokable
2019-10-22 08:42:51 +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
a721a50aa0 feature #34014 [DI] made the %env(base64:...)% processor able to decode base64url (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[DI] made the `%env(base64:...)%` processor able to decode base64url

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

Commits
-------

3d12e46692 [DI] made the `%env(base64:...)%` processor able to decode base64url
2019-10-22 08:40:20 +02:00
Nicolas Grekas
3d12e46692 [DI] made the %env(base64:...)% processor able to decode base64url 2019-10-22 08:40:11 +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
f5cef028f8 Merge branch '4.3' into 4.4
* 4.3:
  Fix small typo in Exception message
2019-10-22 08:26:21 +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
bbafd76c6c bug #34055 [Console] Revert wrong change (fabpot)
This PR was merged into the 4.4 branch.

Discussion
----------

[Console] Revert wrong change

| 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       | Fix #34012 <!-- prefix each issue number with "Fix #", if any -->
| License       | MIT
| Doc PR        | n/a

This partially reverts #34012 as it breaks uses cases like this:

```
echo "foo\nbar\n" | SHELL_INTERACTIVE=1 symfony console something
```

Commits
-------

f592322251 [Console] Revert wrong change
2019-10-22 08:21:53 +02:00
Fabien Potencier
f592322251 [Console] Revert wrong change 2019-10-22 08:15:10 +02:00
Nicolas Grekas
ae86ab18fa [HttpClient] skip tests implemented in 4.4 2019-10-21 18:09:12 +02:00