Commit Graph

47066 Commits

Author SHA1 Message Date
Nicolas Grekas
4528c1194b bug #36601 [Serializer] do not transform empty \Traversable to Array (soyuka)
This PR was merged into the 4.4 branch.

Discussion
----------

[Serializer] do not transform empty \Traversable to Array

| 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       | na
| License       | MIT
| Doc PR        | na

Today, using `PRESERVE_EMPTY_OBJECTS` ([introduced in 4.0](f28e826627)), the JSON serialization of:

```php
<?php
$object = [];
$object['foo'] = new \ArrayObject();
$object['bar'] = new \ArrayObject(['notempty']);
$object['baz'] = new \ArrayObject(['nested' => new \ArrayObject()]);
```

Outputs:

```json
{"foo":[],"bar":["notempty"],"baz":{"nested":[]}}
```

Instead of the expected:

```json
{"foo":{},"bar":["notempty"],"baz":{"nested":{}}}
```

This issue comes from the Serializer that transforms `Traversable` to an Array [here](11a707200d/src/Symfony/Component/Serializer/Serializer.php (L159)). Also, the `AbstractObjectNormalizer` [doesn't support Traversable](11a707200d/src/Symfony/Component/Serializer/Normalizer/AbstractObjectNormalizer.php (L134)), but he allows to preserve empty objects.

I propose this patch where the fix doesn't transform a `Traversable` to an Array. I see another way to patch this in which we could allow empty Traversable in the `AbstractObjectNormalizer` (not sure it's better though). See attached [other-fix.patch](https://github.com/symfony/symfony/files/4539865/other-fix.log) to see the alternative patch.

Commits
-------

e5c20293fa Fix serializer do not transform empty \Traversable to Array
2020-05-01 23:09:03 +02:00
Vincent Langlet
67b744929f Fix annotation 2020-05-01 19:30:18 +02:00
Nicolas Grekas
c5e5b2d019 [Debug][ErrorHandler] cleanup phpunit.xml.dist files 2020-05-01 18:55:10 +02:00
Artem Oliynyk
567cee5f02 [Translation] Fix for translation:update command updating ICU messages 2020-04-30 20:05:09 +02:00
Nicolas Grekas
f8d3b0626a bug #36606 [Cache] Fixed not supported Redis eviction policies (SerheyDolgushev)
This PR was merged into the 4.4 branch.

Discussion
----------

[Cache] Fixed not supported Redis eviction policies

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

**Steps to reproduce:**
1. Define the following redis service on SymfonyCloud:
```
rediscache:
    type: redis:5.0
    size: S
    configuration:
        maxmemory_policy: allkeys-lru
```
2. Deploy the change

**Expected result:**
No redis cache will be populated

**Actual result:**
Following exception is thrown:
```
[2020-04-28T05:35:58.440403-04:00] php.CRITICAL: Uncaught Error: Return value of Symfony\Component\Cache\Adapter\RedisTagAwareAdapter::doSave() must be of the type array, bool returned {"exception":"[object] (TypeError(code: 0): Return value of Symfony\\Component\\Cache\\Adapter\\RedisTagAwareAdapter::doSave() must be of the type array, bool returned at /app/vendor/symfony/cache/Adapter/RedisTagAwareAdapter.php:100)"} []
```

Commits
-------

3d6e942da5 [Cache] Fixed not supported Redis eviction policies
2020-04-30 19:47:27 +02:00
Fabien Potencier
f7749c3774 bug #36625 [PhpUnitBridge] fix compat with PHP 5.3 (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[PhpUnitBridge] fix compat with PHP 5.3

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

Commits
-------

856ba8c98f [PhpUnitBridge] fix compat with PHP 5.3
2020-04-30 15:45:08 +02:00
Nicolas Grekas
856ba8c98f [PhpUnitBridge] fix compat with PHP 5.3 2020-04-29 17:41:38 +02:00
Fabien Potencier
cd66cd57a0 bumped Symfony version to 4.4.9 2020-04-28 20:52:27 +02:00
Fabien Potencier
8e1c507fce
Merge pull request #36614 from fabpot/release-4.4.8
released v4.4.8
2020-04-28 20:48:03 +02:00
Fabien Potencier
f7b9d93cb2 updated VERSION for 4.4.8 2020-04-28 20:47:42 +02:00
Fabien Potencier
d408c55845 updated CHANGELOG for 4.4.8 2020-04-28 20:47:32 +02:00
Nicolas Grekas
dfc4a71eac [Validator] fix merge 2020-04-28 20:23:58 +02:00
Nicolas Grekas
49b74baab4 Merge branch '3.4' into 4.4
* 3.4:
  updated VERSION for 3.4.40
  update CONTRIBUTORS for 3.4.40
  updated CHANGELOG for 3.4.40
  [WebProfilerBundle] changed label of peak memory usage in the time & memory panels (MB into MiB)
  add tests for the ConstraintViolationBuilder class
  Improve dirname usage
  [PhpUnitBridge] Use COMPOSER_BINARY env var if available
  [YAML] escape DEL(\x7f)
  fix compatibility with phpunit 9
  [Cache] skip APCu in chains when the backend is disabled
  [Form] apply automatically step=1 for datetime-local input
2020-04-28 19:55:16 +02:00
Christian Flothmann
88d836643a provide a useful message when extension types don't match 2020-04-28 19:46:51 +02:00
Fabien Potencier
ad6f8608e9
Merge pull request #36612 from fabpot/release-3.4.40
released v3.4.40
2020-04-28 19:41:57 +02:00
Fabien Potencier
f59e0e9c23 updated VERSION for 3.4.40 2020-04-28 19:41:38 +02:00
Fabien Potencier
1822b065d7 update CONTRIBUTORS for 3.4.40 2020-04-28 19:41:24 +02:00
Fabien Potencier
99080bdbe7 updated CHANGELOG for 3.4.40 2020-04-28 19:40:55 +02:00
Serhey Dolgushev
3d6e942da5 [Cache] Fixed not supported Redis eviction policies 2020-04-28 12:13:53 +01:00
soyuka
e5c20293fa Fix serializer do not transform empty \Traversable to Array 2020-04-27 16:07:50 +02:00
Filippo Tessarotto
4774946fbd [BrowserKit] Allow Referer set by history to be overridden (3.4) 2020-04-27 08:55:12 +02:00
Gabriel Ostrolucký
ee7fc5544e
[Console] Default hidden question to 1 attempt for non-tty session 2020-04-27 05:08:14 +02:00
Nicolas Grekas
1bc3ee798d bug #36536 [Cache] Allow invalidateTags calls to be traced by data collector (l-vo)
This PR was merged into the 4.4 branch.

Discussion
----------

[Cache] Allow invalidateTags calls to be traced by data collector

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

`TraceableTagAwareAdapter` is not used in the fullstack framework since tag aware pools don't have the `cache.pool` tag (it's the decorated adapter that has it). This PR aims to use `TraceableTagAwareAdapter` when a pool is configured with `tags: true`

Commits
-------

28fdb3a879 Allow invalidateTags calls to be traced by data collector
2020-04-26 16:19:08 +02:00
Nicolas Grekas
048e6f3dd8 minor #36571 [WebProfilerBundle] changed label of peak memory usage in the time & memory panels (MB into MiB) (Lozik)
This PR was squashed before being merged into the 3.4 branch.

Discussion
----------

[WebProfilerBundle] changed label of peak memory usage in the time & memory panels (MB into MiB)

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #36533
| License       | MIT
| Doc PR        | none
<!--
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 master.
-->
This PR changes the label of the peak memory usage from `MB` into `MiB` in the time and memory panels of the web profiler, as discussed in #36533.

The changed file `Resources/views/Collector/time.html.twig` is completely updated by commit c9433b0090 for v4.3. So for correctly displaying the label in 4.4 (& 5.0), the file `Resources/views/Collector/time.js` needs to be updated.

Commits
-------

89fb0799cd [WebProfilerBundle] changed label of peak memory usage in the time & memory panels (MB into MiB)
2020-04-26 14:49:57 +02:00
Loïc Beurlet
89fb0799cd [WebProfilerBundle] changed label of peak memory usage in the time & memory panels (MB into MiB) 2020-04-26 14:49:41 +02:00
Fabien Potencier
1889672a59 minor #36584 [Validator] add tests for the ConstraintViolationBuilder class (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

[Validator] add tests for the ConstraintViolationBuilder class

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

Commits
-------

fb3aaefbf2 add tests for the ConstraintViolationBuilder class
2020-04-26 12:56:11 +02:00
Christian Flothmann
fb3aaefbf2 add tests for the ConstraintViolationBuilder class 2020-04-26 10:10:12 +02:00
Fabien Potencier
e3dc5effa6 bug #36566 [PhpUnitBridge] Use COMPOSER_BINARY env var if available (fancyweb)
This PR was merged into the 3.4 branch.

Discussion
----------

[PhpUnitBridge] Use COMPOSER_BINARY env var if available

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

Commits
-------

6dce90d47b [PhpUnitBridge] Use COMPOSER_BINARY env var if available
2020-04-25 14:18:34 +02:00
Fabien Potencier
b3cdf5c989 minor #36568 [PhpUnitBridge] Improve dirname usage (Jean85)
This PR was merged into the 3.4 branch.

Discussion
----------

[PhpUnitBridge] Improve dirname usage

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

This is a very small performance improvement on top of #36539

Commits
-------

e721cfd65c Improve dirname usage
2020-04-25 14:02:39 +02:00
Alessandro Lai
e721cfd65c
Improve dirname usage 2020-04-24 16:08:51 +02:00
Thomas Calvet
6dce90d47b [PhpUnitBridge] Use COMPOSER_BINARY env var if available 2020-04-24 14:56:41 +02:00
Laurent VOULLEMIER
28fdb3a879 Allow invalidateTags calls to be traced by data collector 2020-04-24 13:56:40 +02:00
Fabien Potencier
fe5eacd3a2 bug #36560 [YAML] escape DEL(\x7f) (sdkawata)
This PR was merged into the 3.4 branch.

Discussion
----------

[YAML] escape DEL(\x7f)

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

Commits
-------

734d97bdcc [YAML] escape DEL(\x7f)
2020-04-24 12:37:21 +02:00
sdkawata
734d97bdcc [YAML] escape DEL(\x7f) 2020-04-24 19:16:04 +09:00
Fabien Potencier
719bb15c38 bug #36539 [PhpUnitBridge] fix compatibility with phpunit 9 (garak)
This PR was merged into the 3.4 branch.

Discussion
----------

[PhpUnitBridge] fix compatibility with phpunit 9

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

See related issue

Commits
-------

e27ed28bae fix compatibility with phpunit 9
2020-04-24 10:28:23 +02:00
Fabien Potencier
259f523010 bug #36555 [Cache] skip APCu in chains when the backend is disabled (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[Cache] skip APCu in chains when the backend is disabled

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

I think this should do it.

Commits
-------

5a7208481d [Cache] skip APCu in chains when the backend is disabled
2020-04-24 10:25:10 +02:00
Massimiliano Arione
e27ed28bae
fix compatibility with phpunit 9 2020-04-24 09:55:53 +02:00
Nicolas Grekas
5a7208481d [Cache] skip APCu in chains when the backend is disabled 2020-04-23 23:50:38 +02:00
Nicolas Grekas
ea69f77b70 bug #36523 [Form] apply automatically step=1 for datetime-local input (ottaviano)
This PR was merged into the 3.4 branch.

Discussion
----------

[Form] apply automatically step=1 for datetime-local input

| 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       | ~
| License       | MIT
| Doc PR        |

this PR just reapplies the same fix from `TimeType` (https://github.com/symfony/symfony/pull/10777 thanks @tucksaun) to `DateTimeType`.

### before:
```php
'widget' => 'single_text',
'with_seconds' => true,
```
![image](https://user-images.githubusercontent.com/4582866/79972699-a5369500-8496-11ea-8272-d43b68ff49b5.png)

### after:
```php
'widget' => 'single_text',
'with_seconds' => true,
```
![image](https://user-images.githubusercontent.com/4582866/79972801-cbf4cb80-8496-11ea-9af5-b193445b1f1d.png)

Commits
-------

3c24cfecdd [Form] apply automatically step=1 for datetime-local input
2020-04-23 22:22:05 +02:00
Nicolas Grekas
2d7b0b8dad bug #36519 [FrameworkBundle] debug:autowiring: Fix wrong display when using class_alias (weaverryan)
This PR was merged into the 4.4 branch.

Discussion
----------

[FrameworkBundle] debug:autowiring: Fix wrong display when using class_alias

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

Imagine that `FooInterface` is an alias, but it is deprecated and so has a `class_alias` to `BarInterface`. Currently, `debug:autowiring` will actually print that's the autowiring alias is `BarInterface`, despite there being no such id in the container.

@nicolas-grekas originally (on purpose) made the 2nd argument to `Descriptor::getClassDescription()` be passed by reference *for* this exact feature - 56aab09b01 - but I can't figure out why. This change (which effectively removes the by-reference modifying) made no existing tests fail.

Discovered this because the whole deprecated`Doctrine\Common\Persistence\ManagerRegistry` vs newer `Doctrine\Persistence\ManagerRegistry` causes the issue.

Thanks!

Commits
-------

d34b437ce0 Fixing a bug where class_alias would cause incorrect items in debug:autowiring
2020-04-23 22:17:53 +02:00
Thomas Calvet
fc6cf3d3c6 [DX] Show the ParseException message in YAML file loaders 2020-04-23 16:16:02 +02:00
Fabien Potencier
bbbf80f60b minor #36546 [Mailer] Add a comment to avoid more wrong PRs on this piece of code (fabpot)
This PR was merged into the 4.4 branch.

Discussion
----------

[Mailer] Add a comment to avoid more wrong PRs on this piece of code

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

Commits
-------

444e616f6b [Mailer] Add a comment to avoid more wrong PRs on this piece of code
2020-04-23 14:42:49 +02:00
Fabien Potencier
444e616f6b [Mailer] Add a comment to avoid more wrong PRs on this piece of code 2020-04-23 14:41:43 +02:00
Dimitri Gritsajuk
3c24cfecdd [Form] apply automatically step=1 for datetime-local input 2020-04-22 12:34:32 +02:00
Nicolas Grekas
119ba3b742 bug #36454 [DependencyInjection][ServiceSubscriber] Support late aliases (fancyweb)
This PR was merged into the 4.4 branch.

Discussion
----------

[DependencyInjection][ServiceSubscriber] Support late aliases

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

A service subscriber that references a service that is aliased after optimization passes (after ResolveReferencesToAliasesPass technically) end up being dumped with the real service and not the alias.

I would consider it a bug but @nicolas-grekas told me it's a feature for him, this is why I'm submitting this on master.

@nicolas-grekas, feel free to close this one and open with your solution since you definitely know the subject better.

Commits
-------

24150370c3 [DependencyInjection][ServiceSubscriber] Support late aliases
2020-04-21 23:46:25 +02:00
Nicolas Grekas
15d2b77632 fix merge 2020-04-21 23:19:23 +02:00
Nicolas Grekas
0ed6cfd412 Merge branch '3.4' into 4.4
* 3.4:
  [FrameworkBundle] Fix session.attribute_bag service definition
  Update LdapBindAuthenticationProvider.php
2020-04-21 23:01:55 +02:00
Nicolas Grekas
08ded7fed6 bug #36498 [Security/Core] fix escape for username in LdapBindAuthenticationProvider.php (stoccc)
This PR was merged into the 3.4 branch.

Discussion
----------

[Security/Core] fix escape for username in LdapBindAuthenticationProvider.php

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

I think that when we call `ldap_search()` as definitely it will do the `$this->ldap->query()` call, the proper filter applied should be `LdapInterface::ESCAPE_FILTER` as documented in
https://www.php.net/manual/en/function.ldap-escape.php while `LdapInterface::ESCAPE_DN` should be used for `dn` only

This simple change should fix, I'm sorry if I'm wrong.

Commits
-------

4bda68a9a2 Update LdapBindAuthenticationProvider.php
2020-04-21 22:51:56 +02:00
Nicolas Grekas
6642f09053 bug #36506 [FrameworkBundle] Fix session.attribute_bag service definition (fancyweb)
This PR was merged into the 3.4 branch.

Discussion
----------

[FrameworkBundle] Fix session.attribute_bag service definition

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

It looks like in https://github.com/symfony/symfony/pull/36063, the fact the the `getAttributeBag` method is private was forgotten. It cannot be used as the factory method. I guess we can make it public. Should it maybe marked `@internal`?

Commits
-------

76072c6424 [FrameworkBundle] Fix session.attribute_bag service definition
2020-04-21 22:46:18 +02:00
Nicolas Grekas
60245d94aa bug #36500 [Routing][PrefixTrait] Add the _locale requirement (fancyweb)
This PR was merged into the 4.4 branch.

Discussion
----------

[Routing][PrefixTrait] Add the _locale requirement

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

Commits
-------

9fd62f79fb [Routing] Add missing _locale requirements
2020-04-21 21:59:53 +02:00