Commit Graph

48371 Commits

Author SHA1 Message Date
Jérémy Derussé
1c3721e8ad
Fix circular detection with multiple paths 2020-11-11 19:26:13 +01:00
Nyholm
7b733d651d
[MimeType] Add missing alias for @mime_type 2020-11-10 15:45:35 +01:00
Christian Flothmann
cdfa9c2d8b Merge branch '3.4' into 4.4
* 3.4:
  failing test for issue 38861
  [DoctrineBridge]  indexBy could reference to association columns
2020-11-09 20:21:10 +01:00
Nicolas Grekas
6724ca799a bug #38628 [DoctrineBridge] indexBy could reference to association columns (juanmiguelbesada)
This PR was squashed before being merged into the 3.4 branch.

Discussion
----------

[DoctrineBridge]  indexBy could reference to association columns

| 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 #37982 <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| 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/releases):
 - 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 5.x.
-->

This is my approach to solve #37982. It partials reverts @xabbuh PR #38604

This is my first Symfony contribution, so please, tell me if I need to do something more or something is wrong.

Also, this bug affects 4.x and 5.x versions. I think merging in this branches is done automatically. If not, please tell me.

Thanks you

Commits
-------

f9a0e000e9 failing test for issue 38861
4c36145664 [DoctrineBridge]  indexBy could reference to association columns
2020-11-09 18:47:11 +01:00
Bart Wach
f9a0e000e9 failing test for issue 38861 2020-11-09 18:46:57 +01:00
Juan Miguel Besada
4c36145664 [DoctrineBridge] indexBy could reference to association columns 2020-11-09 18:41:59 +01:00
Fabien Potencier
0ae674a29a bug #39021 [DependencyInjection] Optimize circular collection by removing flattening (jderusse)
This PR was merged into the 4.4 branch.

Discussion
----------

 [DependencyInjection] Optimize circular collection by removing flattening

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

Alternative to #39019

Commits
-------

e649f47726 Optimize circular collection by removing flattening
2020-11-09 13:20:23 +01:00
Jérémy Derussé
e649f47726
Optimize circular collection by removing flattening 2020-11-09 12:28:57 +01:00
Fabien Potencier
46410f876e bug #39031 [Ldap] Fix pagination (jderusse)
This PR was merged into the 4.4 branch.

Discussion
----------

[Ldap] Fix pagination

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

This replaces #38875 to fix a bug introduced by #38392

Commits
-------

4fe0a6f2b9 Fix LDAP pagination
2020-11-09 11:55:57 +01:00
Fabien Potencier
0d10f6b6b8 bug #39038 [DoctrineBridge] also reset id readers (xabbuh)
This PR was merged into the 4.4 branch.

Discussion
----------

[DoctrineBridge]    also reset id readers

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

Commits
-------

784bd0080d also reset id readers
2020-11-09 11:48:59 +01:00
Christian Flothmann
784bd0080d also reset id readers 2020-11-09 09:59:19 +01:00
Jérémy Derussé
4fe0a6f2b9
Fix LDAP pagination 2020-11-07 21:18:28 +01:00
Robin Chalas
b8a5e48105 bug #39025 [DoctrineBridge] Fix DBAL deprecations in middlewares (derrabus)
This PR was merged into the 4.4 branch.

Discussion
----------

[DoctrineBridge] Fix DBAL deprecations in middlewares

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

Commits
-------

969da48c98 [DoctrineBridge] Fix DBAL deprecations in middlewares.
2020-11-07 15:51:28 +01:00
Alexander M. Turek
969da48c98 [DoctrineBridge] Fix DBAL deprecations in middlewares. 2020-11-07 15:21:55 +01:00
Fabien Potencier
be8fd560e3 minor #39017 [ProxyManagerBridge] replace ProxyManager\Version by feature detection (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[ProxyManagerBridge] replace ProxyManager\Version by feature detection

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

I'd like to get rid of this `Version` class, which is the source of so many issues with deps.
This won't remove the class from ocramius/proxy-manager, but that's a separate story that this change could enable in the end :)

Commits
-------

5f77aad6ca [ProxyManagerBridge] replace ProxyManager\Version by feature detection
2020-11-06 17:37:15 +01:00
Nicolas Grekas
5f77aad6ca [ProxyManagerBridge] replace ProxyManager\Version by feature detection 2020-11-06 15:18:27 +01:00
Alexander M. Turek
5e3338c1d7 minor #39009 [CI] Fix invalid Doctrine parameter syntax (Nyholm)
This PR was merged into the 4.4 branch.

Discussion
----------

[CI] Fix invalid Doctrine parameter syntax

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

~~I cannot reproduce locally.. So Im trying to fix this with the help of the CI~~

I have reproduced locally. This fix will help.

```
❯ phpunit Tests/Transport/DoctrineIntegrationTest.php
PHPUnit 8.5.8 by Sebastian Bergmann and contributors.

.E....                                                              6 / 6 (100%)

Time: 111 ms, Memory: 6.00 MB

There was 1 error:

1) Symfony\Component\Messenger\Bridge\Doctrine\Tests\Transport\DoctrineIntegrationTest::testSendWithDelay
Doctrine\DBAL\SQLParserUtilsException: Value for :body not found in params array. Params array key should be "body"

src/Symfony/Component/Messenger/Bridge/Doctrine/vendor/doctrine/dbal/src/SQLParserUtilsException.php:21
src/Symfony/Component/Messenger/Bridge/Doctrine/vendor/doctrine/dbal/src/SQLParserUtils.php:277
src/Symfony/Component/Messenger/Bridge/Doctrine/vendor/doctrine/dbal/src/SQLParserUtils.php:203
src/Symfony/Component/Messenger/Bridge/Doctrine/vendor/doctrine/dbal/src/Connection.php:1019
src/Symfony/Component/Messenger/Bridge/Doctrine/vendor/doctrine/dbal/src/Query/QueryBuilder.php:210
src/Symfony/Component/Messenger/Bridge/Doctrine/Tests/Transport/DoctrineIntegrationTest.php:66

ERRORS!
Tests: 6, Assertions: 8, Errors: 1.
```

Apply patch:

```
❯ phpunit Tests/Transport/DoctrineIntegrationTest.php
PHPUnit 8.5.8 by Sebastian Bergmann and contributors.

......                                                              6 / 6 (100%)

Time: 94 ms, Memory: 6.00 MB

OK (6 tests, 9 assertions)

```

Commits
-------

0ab3032c52 [CI] Fixed invalid doctrine parameter syntax
2020-11-05 22:19:20 +01:00
Nyholm
0ab3032c52
[CI] Fixed invalid doctrine parameter syntax 2020-11-05 21:54:48 +01:00
Robin Chalas
75f8ac1e9b bug #38991 [Console] Fix ANSI when stdErr is not a tty (jderusse)
This PR was merged into the 4.4 branch.

Discussion
----------

[Console] Fix ANSI when stdErr is not a tty

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

Taking the @wouterj 's comment into account (https://github.com/symfony/symfony/issues/38981#issuecomment-721915428)

This PR prevents using the same Formatter for stdOut and stdErr when possible.

When user send a custom formatter (or call `setFormatter`) the previous logic is kept.
Otherwise, symfony is asked to create the Formatter, and thus is able to clone the formatter.

In a future PR targeting 5.3, we could improve the constructor to let people inject 2 distinguished formatters

Commits
-------

f3a398b5af Fix ANSI when stdErr is not a tty
2020-11-05 16:22:05 +01:00
Nicolas Grekas
61b3872b65 bug #38980 [DependencyInjection] Fix circular reference with Factory + Lazy Iterrator (jderusse)
This PR was merged into the 4.4 branch.

Discussion
----------

[DependencyInjection] Fix circular reference with Factory + Lazy Iterrator

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

The issue, occurs when a `factory` iterates over services (think tagged iterator) that also need the `factory`.
The PhpDumper is not able to detect the loop because the TaggedService iterator is flaged as "lazy" which is ignored in the loop detection. 2d7e0b02c6/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php (L474-L476)

See test case for a reproduce case.

This PR takes into account lazy services when computing loops.

I'm not sure this is the right thing to do /cc @nicolas-grekas .
A better solution could be to do this ONLY when the service is used as a factory?

Commits
-------

51ff060603 Fix circular referene with Factory and LazyIterator
2020-11-05 12:51:33 +01:00
Jérémy Derussé
f3a398b5af
Fix ANSI when stdErr is not a tty 2020-11-05 10:51:39 +01:00
Nyholm
94818d2a22
minor #38995 [Security] Fix docblock (derrabus)
This PR was merged into the 4.4 branch.

Discussion
----------

[Security] Fix docblock

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

Commits
-------

60e506835a [Security] Fix docblock.
2020-11-05 09:37:17 +01:00
Alexander M. Turek
60e506835a [Security] Fix docblock. 2020-11-05 00:24:50 +01:00
Jérémy Derussé
51ff060603
Fix circular referene with Factory and LazyIterator 2020-11-04 15:21:44 +01:00
Alexander M. Turek
e5ec20400c minor #38978 Rename security.pt_PT.xlf to security.pt.xlf (raziel057)
This PR was merged into the 4.4 branch.

Discussion
----------

Rename security.pt_PT.xlf to security.pt.xlf

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

Missing translations for Portuguese (pt).

As agreed in https://github.com/symfony/symfony/issues/38739#issuecomment-721210579 the common Portuguese translation file for security domain should be ``security.pt.xlf`` rather than ``security.pt_PT.xlf``

Commits
-------

3dd385f319 Rename security.pt_PT.xlf to security.pt.xlf
2020-11-03 20:16:45 +01:00
Thomas Lallement
3dd385f319
Rename security.pt_PT.xlf to security.pt.xlf 2020-11-03 17:58:31 +01:00
Nicolas Grekas
6fe261a7ae fix typo 2020-11-03 13:14:11 +01:00
Michael Voříšek
75ff86811f [HttpFoundation] Fix for virtualhosts based on URL path 2020-11-03 12:58:18 +01:00
Nicolas Grekas
703497dccf bug #38971 [PhpUnitBridge] fix replaying skipped tests (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[PhpUnitBridge] fix replaying skipped tests

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

Spotted while working on https://github.com/symfony/polyfill/pull/310

See also https://3v4l.org/D6Gro for the newly skipped tests in symfony/intl

Commits
-------

849d1b3845 [PhpUnitBridge] fix replaying skipped tests
2020-11-03 12:57:46 +01:00
Nicolas Grekas
849d1b3845 [PhpUnitBridge] fix replaying skipped tests 2020-11-03 12:50:26 +01:00
Fabien Potencier
e04777966a minor #38967 Switch nightly run to 8.0snapshot (derrabus)
This PR was merged into the 4.4 branch.

Discussion
----------

Switch nightly run to 8.0snapshot

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

It's too early to test on php 8.1, so let's switch to 8.0 instead.

Commits
-------

b4730cbe1d Switch nightly run to 8.0snapshot
2020-11-03 07:19:11 +01:00
Alexander M. Turek
b4730cbe1d Switch nightly run to 8.0snapshot 2020-11-02 22:35:35 +01:00
Nicolas Grekas
76c19393c8 [HttpKernel] fix merge 2020-11-02 17:06:19 +01:00
Nicolas Grekas
5831ab2b62 bug #38910 [HttpKernel] Fix session initialized several times (jderusse)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpKernel] Fix session initialized several times

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

The session injected in the request is a factory. When the request is **cloned** (ie sub-request) while the session is not yet used in the master request (the session is still a factory), both Master and Sub request will have a factory.
If both requests attempt to read the session afterward, they both triggers the factory, and both initialize the session.

It's not a dead end for the `SessionListener` because the session come from the container and is shared, but:
- the session is initialized ($storage->setOptions(['cookie_secure' => true])) twice
- if we replace the sesssion from container to a factory, it could be an issue

Commits
-------

30a3c7c87b Fix session called initized several time
2020-11-02 16:36:10 +01:00
Nicolas Grekas
8375eeef67 bug #38882 [DependencyInjection] Improve performances in CircualReference detection (jderusse)
This PR was merged into the 4.4 branch.

Discussion
----------

[DependencyInjection] Improve performances in CircualReference detection

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

This PR change the way circular references are detected.  And improve the project submitted in #37850 [by **86%**](https://blackfire.io/profiles/compare/cc4aa41d-5b63-4caa-9a1b-fc282dc5d64a/graph) (Build the container in 1.1 sec instead of 10)

Issue is: When a project contains a lot Circular Reference, the Dumper [spend a lot of time](https://blackfire.io/profiles/54f6eba2-b93c-4f2b-a268-1e58883faecb/graph) in merging those circular references.
note: a circular reference is not an issue when an service is not injected by constructor, but this Can not be known until all references are resolved (performed previously by connectCircularReferences)

This PR removed the connectCircularReferences and generate a flatten tree of dependencies:
 - the key is the service ID
 - the value is the list of direct **AND** indirect dependency + path to join the dependency

I also [benched the PR with a project with few references](https://blackfire.io/profiles/compare/2f9902e6-3347-40b3-8421-e1fd09c067d2/graph) and result are almost the same before/after.

Commits
-------

d4db75692b Improve performances in CircualReference detection
2020-11-02 16:10:49 +01:00
Nicolas Grekas
ed217a1435 bug #38950 [Process] Dont test TTY if there is no TTY support (Nyholm)
This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

[Process] Dont test TTY if there is no TTY support

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

Commits
-------

e918e5ab30 [Process] Dont test TTY if there is no TTY support
2020-11-02 16:10:23 +01:00
Nyholm
e918e5ab30 [Process] Dont test TTY if there is no TTY support 2020-11-02 16:10:16 +01:00
Nicolas Grekas
ca9ef822cf bug #38921 [PHPUnitBridge] Fixed crash on Windows with PHP 8 (villfa)
This PR was merged into the 4.4 branch.

Discussion
----------

[PHPUnitBridge] Fixed crash on Windows with PHP 8

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

The install command crashed with the message "The filename, directory name, or volume label syntax is incorrect.".
It happens only on Windows with PHP 8.

Probably due to https://github.com/php/php-src/blob/PHP-8.0/UPGRADING#L1121-L1123

I have a small repo to show the problem and how it is fixed: https://github.com/villfa/test-phpunit-bridge

Commits
-------

4b958917fd [PHPUnitBridge] Fixed crash on Windows with PHP 8
2020-11-02 16:07:32 +01:00
Nicolas Grekas
cd53800026 minor #38917 Fixing some Mongolian (Nyholm)
This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

Fixing some Mongolian

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

Hey @luffy1727, could you help me with the last two strings here?

Commits
-------

5c848d9796 Fixing some Mongolian
2020-11-02 16:02:38 +01:00
Nyholm
5c848d9796 Fixing some Mongolian 2020-11-02 16:02:29 +01:00
Nicolas Grekas
9f194355a3 minor #38930 translating the validators for european portuguese language (brunosinister)
This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

translating the validators for european portuguese language

| Q             | A
| ------------- | ---
| Branch?       | 5.x for features / 4.4 or 5.1 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 #", no need to create an issue if none exist, explain below instead -->
| 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/releases):
 - 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 5.x.
-->

Commits
-------

c0524197a0 translating the validators for european portuguese language
2020-11-02 16:00:34 +01:00
Bruno Araujo
c0524197a0 translating the validators for european portuguese language 2020-11-02 16:00:21 +01:00
Nicolas Grekas
23fe33c840 minor #38963 Update validators.he.xlf (ben29)
This PR was merged into the 4.4 branch.

Discussion
----------

Update validators.he.xlf

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

Commits
-------

b99977efce Update validators.he.xlf
2020-11-02 15:37:14 +01:00
Nicolas Grekas
e6250eabcf Merge branch '3.4' into 4.4
* 3.4:
  Fix CI
2020-11-02 15:31:22 +01:00
Nicolas Grekas
427e314212 Fix CI 2020-11-02 15:30:42 +01:00
Ben Hakim
b99977efce
Update validators.he.xlf 2020-11-02 16:11:24 +02:00
Alexander M. Turek
ba7c60b745 minor #38961 Update validators.he.xlf (ben29)
This PR was merged into the 4.4 branch.

Discussion
----------

Update validators.he.xlf

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

Commits
-------

98a7e8e150 Update validators.he.xlf
2020-11-02 15:00:41 +01:00
Alexander M. Turek
821c437451 minor #38962 Update security.he.xlf (ben29)
This PR was merged into the 4.4 branch.

Discussion
----------

Update security.he.xlf

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

Commits
-------

c8ab10f427 Update security.he.xlf
2020-11-02 14:59:36 +01:00
Ben Hakim
c8ab10f427
Update security.he.xlf 2020-11-02 15:41:03 +02:00
Ben Hakim
98a7e8e150
Update validators.he.xlf 2020-11-02 15:36:19 +02:00