Commit Graph

43656 Commits

Author SHA1 Message Date
Nicolas Grekas
8033fc5a1d Merge branch '3.4' into 4.3
* 3.4:
  Do not include hidden commands in suggested alternatives
  [DependencyInjection] Fix wrong exception when service is synthetic
2019-09-28 16:55:46 +02:00
Nicolas Grekas
944cda7969 bug #33748 [Console] Do not include hidden commands in suggested alternatives (m-vo)
This PR was merged into the 3.4 branch.

Discussion
----------

[Console] Do not include hidden commands in suggested alternatives

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

Partially backports #33412 on 3.4, avoids leaking the names of hidden commands in suggested alternatives on command not found.

Commits
-------

8a9d173c36 Do not include hidden commands in suggested alternatives
2019-09-28 16:54:55 +02:00
M. Vondano
8a9d173c36 Do not include hidden commands in suggested alternatives 2019-09-28 16:39:43 +02:00
Roland Franssen
82f341864c [DI] Add CSV env var processor tests 2019-09-28 11:59:10 +02:00
Nicolas Grekas
293a22a433 bug #33625 [DependencyInjection] Fix wrong exception when service is synthetic (k0d3r1s)
This PR was squashed before being merged into the 3.4 branch (closes #33625).

Discussion
----------

[DependencyInjection] Fix wrong exception when service is synthetic

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

This fixes wrongfully thrown exception when service is defined as synthetic and some arguments are binded in _defaults

Commits
-------

152dec95bc [DependencyInjection] Fix wrong exception when service is synthetic
2019-09-27 17:48:09 +02:00
k0d3r1s
152dec95bc [DependencyInjection] Fix wrong exception when service is synthetic 2019-09-27 17:47:48 +02:00
Nicolas Grekas
fbfdebc487 fix merge (bis) 2019-09-27 16:39:13 +02:00
Nicolas Grekas
d4d81be289 fix merge 2019-09-27 16:37:39 +02:00
Nicolas Grekas
7bb421bd45 Merge branch '3.4' into 4.3
* 3.4:
  [Form][Validator][Intl] Fix tests
  [Validator] Accept underscores in the URL validator as the URL will resolve correctly
  [Translation] Collect original locale in case of fallback translation
  Fix toolbar load when GET params are present in "_wdt" route
2019-09-27 16:21:32 +02:00
Nicolas Grekas
82a62d2bd6 minor #33739 [Form][Validator][Intl] Fix tests (ro0NL)
This PR was merged into the 3.4 branch.

Discussion
----------

[Form][Validator][Intl] Fix tests

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix https://github.com/symfony/symfony/pull/33148#issuecomment-535929906
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->
<!--
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 4.4.
 - Legacy code removals go to the master branch.
-->

Commits
-------

e648a91259 [Form][Validator][Intl] Fix tests
2019-09-27 16:04:35 +02:00
Roland Franssen
e648a91259 [Form][Validator][Intl] Fix tests 2019-09-27 16:00:26 +02:00
Tobias Schultze
abf11d8ba8 bug #32979 [Messenger] return empty envelopes when RetryableException occurs (surikman)
This PR was squashed before being merged into the 4.3 branch (closes #32979).

Discussion
----------

[Messenger] return empty envelopes when RetryableException occurs

| Q             | A
| ------------- | ---
| Branch?       |  3.4 or 4.3 for bug fixes <!-- see below -->
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| License       | MIT
| ~~Doc PR~~ | ~~symfony/symfony-docs#12109~~

<!--
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):
 - 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 4.4.
 - Legacy code removals go to the master branch.
-->

Problem occurs when you are using more than 1 worker with Doctrine Transport.

`Symfony\Component\Messenger\Transport\Doctrine\Connection::get` does a query `SELECT ... FOR UPDATE` and this locking query could lock table and workers stops. But using locks can result in dead locks or lock timeouts. Doctrine renders these SQL errors as RetryableExceptions. These exceptions are often normal if you are in a high concurrency environment. They can happen very often and your application should handle them properly.

Commits
-------

9add32a9ca [Messenger] return empty envelopes when RetryableException occurs
2019-09-27 13:21:51 +02:00
SuRiKmAn
9add32a9ca [Messenger] return empty envelopes when RetryableException occurs 2019-09-27 13:21:34 +02:00
Fabien Potencier
ad89564ebf bug #32522 [Validator] Accept underscores in the URL validator, as the URL will load (battye)
This PR was merged into the 3.4 branch.

Discussion
----------

[Validator] Accept underscores in the URL validator, as the URL will load

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

As @javiereguiluz mentioned, regardless of convention a URL with an underscore in it will load perfectly fine - so in that respect it must be valid.

Commits
-------

c9c7a1118c [Validator] Accept underscores in the URL validator as the URL will resolve correctly
2019-09-27 09:08:14 +02:00
battye
c9c7a1118c [Validator] Accept underscores in the URL validator as the URL will resolve correctly 2019-09-27 08:53:48 +02:00
Fabien Potencier
8dc0814e79 bug #32437 Fix toolbar load when GET params are present in "_wdt" route (Molkobain)
This PR was merged into the 3.4 branch.

Discussion
----------

Fix toolbar load when GET params are present in "_wdt" route

When using a custom router that inject GET parameters, eg:

```
# services.yaml
parameters:
    # Replace default url generator service
    router.options.generator_base_class: Combodo\iTop\Portal\Routing\UrlGenerator
```

The path generated by the toolbar JS is HTML entity encoded which breaks the JS call (`&` becomes `&amp;`).

| Q             | A
| ------------- | ---
| Branch?       | 4.4 for features / 3.4, 4.2 or 4.3 for bug fixes <!-- see below -->
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | #...   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

<!--
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):
 - 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 4.4.
 - Legacy code removals go to the master branch.
-->

Commits
-------

5309e64949 Fix toolbar load when GET params are present in "_wdt" route
2019-09-27 08:10:02 +02:00
Fabien Potencier
650f179c2f bug #32925 [Translation] Collect original locale in case of fallback translation (digilist)
This PR was squashed before being merged into the 3.4 branch (closes #32925).

Discussion
----------

[Translation] Collect original locale in case of fallback translation

Before, it collected the fallback locale that was used to translate a key. But this information is confusing, as it does not reveal which translation key is missing in the requested language.

So I'd like to propose to track the "requested" locale instead, so that the Symfony profiler gives me the information in which locale the key is missing instead of which locale was used as a fallback.

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

In principle, this change is a BC break, but imho also a bug. It's really confusing when the Profiler tells you that it uses a translation fallback for an ID and locale that is actually translated. Took some debugging so recognize that this fallback came from another locale. If you think it's better to target 5.0, I'll update the PR.

Commits
-------

5564e149cb [Translation] Collect original locale in case of fallback translation
2019-09-27 07:57:25 +02:00
Markus Fasselt
5564e149cb [Translation] Collect original locale in case of fallback translation 2019-09-27 07:57:18 +02:00
Nicolas Grekas
dff71cef48 bug #33691 [HttpClient] fix race condition when reading response with informational status (nicolas-grekas)
This PR was merged into the 4.3 branch.

Discussion
----------

[HttpClient] fix race condition when reading response with informational status

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

Spotted by some transiently failing jobs on Travis.

Commits
-------

450c3c4998 [HttpClient] fix race condition when reading response with informational status
2019-09-26 23:20:52 +02:00
Nicolas Grekas
c8dbd1ad75 bug #33727 [HttpClient] workaround bad Content-Length sent by old libcurl (nicolas-grekas)
This PR was merged into the 4.3 branch.

Discussion
----------

[HttpClient] workaround bad Content-Length sent by old libcurl

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

Issue described in https://curl.haxx.se/mail/lib-2014-01/0106.html, happens with curl 7.29 at least.

Commits
-------

b8d2496979 [HttpClient] workaround bad Content-Length sent by old libcurl
2019-09-26 23:18:02 +02:00
Nicolas Grekas
0d05f3e765 Merge branch '3.4' into 4.3
* 3.4:
  [FrameworkBundle] Fix framework bundle lock configuration not working as expected
  [Validator] Add the missing translations for the Azerbaijani locale
  [Cache] dont override native Memcached options
  Fix return type of Process::restart().
2019-09-26 23:17:10 +02:00
Nicolas Grekas
4b2019db78 bug #31198 [FrameworkBundle] Fix framework bundle lock configuration not working as expected (HypeMC)
This PR was squashed before being merged into the 3.4 branch (closes #31198).

Discussion
----------

[FrameworkBundle] Fix framework bundle lock configuration not working as expected

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #31197
| License       | MIT
| Doc PR        | https://github.com/symfony/symfony-docs/pull/11465 & https://github.com/symfony/symfony-docs/pull/11466

This fixes #31197 and makes the lock configuration work with installations that are not full stack ones and configurations that use xml files.

Commits
-------

c7af2df340 [FrameworkBundle] Fix framework bundle lock configuration not working as expected
2019-09-26 22:59:16 +02:00
HypeMC
c7af2df340 [FrameworkBundle] Fix framework bundle lock configuration not working as expected 2019-09-26 22:59:09 +02:00
Nicolas Grekas
ad66a160b1 bug #33719 [Cache] dont override native Memcached options (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[Cache] dont override native Memcached options

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

Commits
-------

894a78e812 [Cache] dont override native Memcached options
2019-09-26 22:41:00 +02:00
Fabien Potencier
bb96c34b97 minor #33728 [Validator] Add the missing translations for the Azerbaijani locale (seferov)
This PR was merged into the 3.4 branch.

Discussion
----------

[Validator] Add the missing translations for the Azerbaijani locale

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

Commits
-------

dde0256e63 [Validator] Add the missing translations for the Azerbaijani locale
2019-09-26 22:19:54 +02:00
Farhad Safarov
dde0256e63 [Validator] Add the missing translations for the Azerbaijani locale 2019-09-26 23:00:18 +03:00
Nicolas Grekas
b8d2496979 [HttpClient] workaround bad Content-Length sent by old libcurl 2019-09-26 21:42:07 +02:00
Nicolas Grekas
894a78e812 [Cache] dont override native Memcached options 2019-09-26 13:13:54 +02:00
Fabien Potencier
0222ea5df9 bug #33703 [Cache] fail gracefully when locking is not supported (nicolas-grekas)
This PR was merged into the 4.3 branch.

Discussion
----------

[Cache] fail gracefully when locking is not supported

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

Commits
-------

93485190f9 [Cache] fail gracefully when locking is not supported
2019-09-26 10:04:46 +02:00
Fabien Potencier
d52515ab1b Fix CS 2019-09-26 09:59:37 +02:00
Fabien Potencier
ebf9f8f71a bug #33713 Fix exceptions (PDOException) error code type (fruty)
This PR was squashed before being merged into the 4.3 branch (closes #33713).

Discussion
----------

Fix exceptions (PDOException) error code type

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

From the [php.net docs](https://www.php.net/manual/en/exception.getcode.php) `Exception::getCode()` description:

> Returns the exception code as integer in Exception but possibly as other type in Exception descendants (for example as **string** in PDOException).

So if can be string, we convert it to the int in the `HandlerFailedException` but it still string in `nestedExceptiions`.

Commits
-------

9efa025a2a Fix exceptions (PDOException) error code type
2019-09-26 09:58:51 +02:00
fruty
9efa025a2a Fix exceptions (PDOException) error code type 2019-09-26 09:58:46 +02:00
Fabien Potencier
d04fdee000 bug #32335 [Form] Names for buttons should start with lowercase (mcfedr)
This PR was merged into the 4.3 branch.

Discussion
----------

[Form] Names for buttons should start with lowercase

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

This fix changes the messages related to the changes in https://github.com/symfony/symfony/pull/28969 - the message used to state that names should start with a letter, a digit ... - so I got a confusing message:

```
Using names for buttons that do not start with a letter, a digit, or an underscore is deprecated since Symfony 4.3 and will throw an exception in 5.0 ("Search" given).'
```

Which made me find the message, look at the regex that was used, and work out that actually it should start with a lowercase letter, and hence this PR - where I assume there is a reason that the name must start with lowercase letters.

Commits
-------

f65524e4e0 Names for buttons should start with lowercase
2019-09-25 21:19:30 +02:00
Fabien Potencier
9523035556 minor #33705 Fix return type of Process::restart() (derrabus)
This PR was merged into the 3.4 branch.

Discussion
----------

Fix return type of Process::restart()

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

`Process::restart()` is annotated with `@return $this`, but it actually returns a clone of the current object. So `@return static` would be more appropriate.

Commits
-------

7d7380d9e7 Fix return type of Process::restart().
2019-09-25 16:56:02 +02:00
Fabien Potencier
29a54c5334 bug #33706 [Mailer][Messenger] ensure legacy event dispatcher compatibility (xabbuh)
This PR was merged into the 4.3 branch.

Discussion
----------

[Mailer][Messenger] ensure legacy event dispatcher compatibility

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

Commits
-------

4fcc1bc6fa ensure legacy event dispatcher compatibility
2019-09-25 16:55:19 +02:00
Christian Flothmann
4fcc1bc6fa ensure legacy event dispatcher compatibility 2019-09-25 16:27:22 +02:00
Alexander M. Turek
7d7380d9e7 Fix return type of Process::restart(). 2019-09-25 16:09:38 +02:00
Nicolas Grekas
93485190f9 [Cache] fail gracefully when locking is not supported 2019-09-25 15:53:41 +02:00
Christian Flothmann
479d8ee2a3 bug #33688 Add missing row_attr option to FormType (mcsky)
This PR was merged into the 4.3 branch.

Discussion
----------

Add missing row_attr option to FormType

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix: #33682 - related issue #33573
| License       | MIT

The #33573 modified Symfony's form themes. But the [FormType](https://github.com/symfony/form/blob/master/Extension/Core/Type/FormType.php) don't allow the option `row_attr` so the OptionResolver throw an exception that the option is unknown.

This PR basically add the option and give it to the form view (like `label_attr` do)

Commits
-------

d711ea2b54 Add missing row_attr option to FormType
2019-09-25 12:11:53 +02:00
Christian Flothmann
a53732f28d bug #33693 [Security] use LegacyEventDispatcherProxy (dmaicher)
This PR was merged into the 4.3 branch.

Discussion
----------

[Security] use LegacyEventDispatcherProxy

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

I ran into an issue on one of my apps that has its own event dispatcher class using the old dispatch method signature

```php
public function dispatch($eventName, Event $event = null)
```

This leads to

```
TypeError: Argument 2 passed to X\Tests\Base\TestEventDispatcher::dispatch() must be an instance of Symfony\Component\EventDispatcher\Event or null, string given, called in /var/www/x/symfony/vendor/symfony/security/Http/Firewall/ContextListener.php on line 230

/var/www/x/symfony/tests/Base/TestEventDispatcher.php:20
/var/www/x/symfony/vendor/symfony/security/Http/Firewall/ContextListener.php:230
/var/www/x/symfony/vendor/symfony/security/Http/Firewall/ContextListener.php:111
```

since the event here is dispatched using the new signature:

https://github.com/symfony/symfony/blob/4.4/src/Symfony/Component/Security/Http/Firewall/ContextListener.php#L259

Commits
-------

7067e48165 [Security] use LegacyEventDispatcherProxy
2019-09-25 11:50:36 +02:00
Christian Flothmann
e01614527f fix version in @deprecated annotation 2019-09-25 09:46:23 +02:00
David Maicher
7067e48165 [Security] use LegacyEventDispatcherProxy 2019-09-24 20:49:43 +02:00
Nicolas Grekas
450c3c4998 [HttpClient] fix race condition when reading response with informational status 2019-09-24 20:09:31 +02:00
Nicolas Grekas
3ab7d57659 Merge branch '3.4' into 4.3
* 3.4:
  [Routing] fix bad fix
2019-09-24 18:23:04 +02:00
Nicolas Grekas
04fe347df9 [Routing] fix bad fix 2019-09-24 18:22:08 +02:00
Nicolas Grekas
1ccc970469 minor #33690 [Security/Http] fix typo in deprecation message (nicolas-grekas)
This PR was merged into the 4.3 branch.

Discussion
----------

[Security/Http] fix typo in deprecation message

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

spotted by @stof in #33676

Commits
-------

e70057aed4 [Security/Http] fix typo in deprecation message
2019-09-24 17:54:42 +02:00
Nicolas Grekas
7031e83a8f Merge branch '3.4' into 4.3
* 3.4:
  Various tweaks 3.4
  [PhpUnit] Fix usleep mock return value
  [Lock] use Predis\ClientInterface instead of Predis\Client
2019-09-24 17:54:14 +02:00
Nicolas Grekas
e70057aed4 [Security/Http] fix typo in deprecation message 2019-09-24 17:43:44 +02:00
Kevin Grenier
d711ea2b54 Add missing row_attr option to FormType 2019-09-24 17:38:26 +02:00
Fabien Potencier
7c04a82a47 bug #33675 [PhpUnit] Fix usleep mock return value (fabpot)
This PR was merged into the 3.4 branch.

Discussion
----------

[PhpUnit] Fix usleep mock return value

| 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       | n/a| License       | MIT
| Doc PR        | n/a

`usleep` does not return anything.

Commits
-------

8198d93c5b [PhpUnit] Fix usleep mock return value
2019-09-24 07:30:09 +02:00