Commit Graph

43754 Commits

Author SHA1 Message Date
Fabien Potencier
767b265681 bug #34179 [Stopwatch] Fixed a bug in StopwatchEvent::getStartTime (TimoBakx)
This PR was merged into the 3.4 branch.

Discussion
----------

[Stopwatch] Fixed a bug in StopwatchEvent::getStartTime

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

When using a `StopwatchEvent` with an `$origin` that's smaller than the first start time, calling `getStartTime()` before ending the event will give `0` instead of the correct number.

The proposed fix in #34088 fixes this.

Commits
-------

b2b7eab949 [Stopwatch] Fixed a bug in stopwatch event getStartTime
2019-11-03 13:11:53 +01:00
Fabien Potencier
a1b507974e bug #34203 [FrameworkBundle] [HttpKernel] fixed correct EOL and EOM month (erics86)
This PR was submitted for the master branch but it was merged into the 3.4 branch instead (closes #34203).

Discussion
----------

[FrameworkBundle] [HttpKernel] fixed correct EOL and EOM month

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

Commits
-------

613717d71f [FrameworkBundle] [HttpKernel] fixed correct EOL and EOM month
2019-11-03 13:06:46 +01:00
Eric Schildkamp
613717d71f [FrameworkBundle] [HttpKernel] fixed correct EOL and EOM month
* Added a hardcoded day 01 in order to output the proper month November
which is the correct EOL and EOM month.
* \DateTime::createFromFormat('mY') will output December for every month
where day 31 exists.
2019-11-03 13:06:33 +01:00
Fabien Potencier
22976d0f54 bug #34035 [Serializer] Fix property name usage for denormalization (antograssiot)
This PR was squashed before being merged into the 4.3 branch (closes #34035).

Discussion
----------

[Serializer] Fix property name usage for denormalization

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

Using the `@SerializedName()` and passing it an existing property name affects the deserialization even if `@Groups()` are not supposed to be involved.

## How to reproduce

Given the following class
```php

class Foo
{
    /**
     * @Group("list")
     */
    private $bar;

    public function setBar($bar)
    {
        $this->bar = $bar;
    }
    public function getBar()
    {
        return $this->bar;
    }
    /**
     * @Groups({"list:export"})
     * @SerializedName("bar")
     */
    public function getBarForExport()
    {
        return $this->bar.' Rocks';
    }
}
```

This allow us to change the content of the property based on the normalization context.

```php
$obj = new Foo();
$obj->setBar('Api Platform');

$data = $normalizer->normalize($obj, null, ['groups' => ["list"]]);
// $data => ['bar' => 'Api Platform'] as expected

$data = $normalizer->normalize($obj, null, ['groups' => ["list:export"]]);
// $data => ['bar' => 'Api Platform Rocks'] as expected

$obj = $normalizer->denormalize(['bar' => 'Api Platform'], Foo::class, null, ['groups' => ['list']]);
// $obj->getBar()  would return null instead of 'Api Platform' as expected.
```

Commits
-------

8ca4a3f345 [Serializer] Fix property name usage for denormalization
2019-11-03 12:04:07 +01:00
Anto
8ca4a3f345 [Serializer] Fix property name usage for denormalization 2019-11-03 12:04:02 +01:00
Fabien Potencier
69c0fc6727 minor #34226 Name test accordingly to the tested class (OskarStark)
This PR was merged into the 4.3 branch.

Discussion
----------

Name test accordingly to the tested class

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

<!--
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
-------

2ce086ab29 Name test accordingly to the tested class
2019-11-03 11:51:12 +01:00
Fabien Potencier
85bcd9d554 minor #34225 [HttpFoundation] MockFileSessionStorageTest::sessionDir being used after it's unset (HypeMC)
This PR was merged into the 3.4 branch.

Discussion
----------

[HttpFoundation] MockFileSessionStorageTest::sessionDir being used after it's unset

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

The `$sessionDir` property was used after being set to `null`.

Commits
-------

51b20dd895 Fix MockFileSessionStorageTest::sessionDir being used after it's unset
2019-11-03 11:46:27 +01:00
Oskar Stark
2ce086ab29
Name test accordingly to the tested class 2019-11-03 10:04:05 +01:00
HypeMC
51b20dd895 Fix MockFileSessionStorageTest::sessionDir being used after it's unset 2019-11-03 03:12:45 +01:00
Fabien Potencier
ce6332ce71 bumped Symfony version to 4.3.7 2019-11-01 11:04:19 +01:00
Fabien Potencier
7e98605f0e
Merge pull request #34209 from fabpot/release-4.3.6
released v4.3.6
2019-11-01 10:00:21 +00:00
Fabien Potencier
b959f05d98 updated VERSION for 4.3.6 2019-11-01 11:00:03 +01:00
Fabien Potencier
48373ab261 updated CHANGELOG for 4.3.6 2019-11-01 10:59:55 +01:00
Fabien Potencier
36c4c66a60 bumped Symfony version to 3.4.34 2019-11-01 10:59:17 +01:00
Fabien Potencier
4781365269
Merge pull request #34208 from fabpot/release-3.4.33
released v3.4.33
2019-11-01 09:46:51 +00:00
Fabien Potencier
a3ae48695d updated VERSION for 3.4.33 2019-11-01 10:46:31 +01:00
Fabien Potencier
202e420505 update CONTRIBUTORS for 3.4.33 2019-11-01 10:46:18 +01:00
Fabien Potencier
9d81271d9b updated CHANGELOG for 3.4.33 2019-11-01 10:45:21 +01:00
Nicolas Grekas
06e745847d bug #34198 [HttpClient] Fix perf issue when doing thousands of requests with curl (nicolas-grekas)
This PR was merged into the 4.3 branch.

Discussion
----------

[HttpClient] Fix perf issue when doing thousands of requests with curl

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

Performing while scheduling requests was a terrible idea: it makes buffers fill in memory and requires CPU do deal with the pending list, while all this in dealt with much more efficiently by any response-reading code that comes after.

Commits
-------

e388b739ed [HttpClient] Fix perf issue when doing thousands of requests with curl
2019-10-31 14:38:12 +01:00
Nicolas Grekas
e388b739ed [HttpClient] Fix perf issue when doing thousands of requests with curl 2019-10-31 08:19:20 +01:00
Antonio Pauletich
16c9bafee4
Fix URL generator instantiation 2019-10-30 20:24:37 +01:00
Nicolas Grekas
e8b31ff608 minor #34176 [4.3] Remove unused local variables (fancyweb)
This PR was merged into the 4.3 branch.

Discussion
----------

[4.3] Remove unused local variables

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

Follow up of https://github.com/symfony/symfony/pull/34105 on 4.3.

Commits
-------

58161b8eec [4.3] Remove unused local variables
2019-10-30 14:18:51 +01:00
Timo Bakx
b2b7eab949 [Stopwatch] Fixed a bug in stopwatch event getStartTime 2019-10-30 14:03:57 +01:00
Thomas Calvet
58161b8eec [4.3] Remove unused local variables 2019-10-30 13:58:49 +01:00
Nicolas Grekas
1aaf58b55a Merge branch '3.4' into 4.3
* 3.4:
  [Config] Disable default alphabet sorting in glob function due of unstable sort
  [Serializer] Improve messages for unexpected resources values
  [SecurityBundle] correct types for default arguments for firewall configs
2019-10-30 13:53:54 +01:00
Nicolas Grekas
27b0baa270 bug #33998 [Config] Disable default alphabet sorting in glob function due of unstable sort (hurricane-voronin)
This PR was squashed before being merged into the 3.4 branch.

Discussion
----------

[Config] Disable default alphabet sorting in glob function due of unstable sort

…table sort

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

`\Symfony\Component\Config\Resource\GlobResource::getIterator` loads files using `glob` not it the stable sorting, e.g several files: `doctrine.yml` and `doctrine_mongodb.yaml` in `config/packages` folder.
On requests these files come(randomly) in a different order, which leads to reinitialization of symfony kernel in `dev` environment. It's a little bit annoying and takes a lot of time in a common :(

<!--
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
-------

3bed0247c0 [Config] Disable default alphabet sorting in glob function due of unstable sort
2019-10-30 13:46:47 +01:00
Denys Voronin
3bed0247c0 [Config] Disable default alphabet sorting in glob function due of unstable sort 2019-10-30 13:43:22 +01:00
Nicolas Grekas
1a92f44a33 bug #34144 [Serializer] Improve messages for unexpected resources values (fancyweb)
This PR was merged into the 3.4 branch.

Discussion
----------

[Serializer] Improve messages for unexpected resources values

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

Before: `An unexpected value could not be serialized: NULL` - very misleading

After: `An unexpected value could not be serialized: a "stream" resource`

Commits
-------

ad2ce276c7 [Serializer] Improve messages for unexpected resources values
2019-10-30 13:39:30 +01:00
Nicolas Grekas
c424c5adb7 bug #34186 [HttpClient] always return the empty string when the response cannot have a body (nicolas-grekas)
This PR was merged into the 4.3 branch.

Discussion
----------

[HttpClient] always return the empty string when the response cannot have a body

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

This will fix tests on 4.4 also.

Commits
-------

f78e14332e [HttpClient] always return the empty string when the response cannot have a body
2019-10-30 13:01:49 +01:00
Nicolas Grekas
f78e14332e [HttpClient] always return the empty string when the response cannot have a body 2019-10-30 12:53:18 +01:00
Timo Bakx
af00d8deab [Stopwatch] Fixed bug in getDuration when counting multiple ongoing periods 2019-10-29 21:16:34 +01:00
Yonel Ceruto
2b0a5793d1 minor #34174 [TwigBundle][exception] Added missing css variable to highlight line in trace (lyrixx)
This PR was merged into the 4.3 branch.

Discussion
----------

[TwigBundle][exception] Added missing css variable to highlight line in trace

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

---

To get the yellow background
![image](https://user-images.githubusercontent.com/408368/67779323-c331b880-fa64-11e9-9a2f-97730a89a6d6.png)

Commits
-------

5f19501 [TwigBundle][exception] Added missing css variable to highlight line in trace
2019-10-29 11:04:07 -04:00
Grégoire Pineau
5f19501fc4 [TwigBundle][exception] Added missing css variable to highlight line in trace 2019-10-29 15:56:06 +01:00
Nicolas Grekas
2326f2882c bug #34167 [HttpFoundation] Allow to not pass a parameter to Request::isMethodSafe() (dunglas)
This PR was squashed before being merged into the 4.3 branch.

Discussion
----------

[HttpFoundation] Allow to not pass a parameter to Request::isMethodSafe()

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

This parameter was already deprecated in Symfony 4. Allowing to not pass it in Symfony 4.3 without triggering a deprecation allows to support both HttpFoundation 4.3 and 4.4, otherwise it's not possible.

Needed to make API Platform compatible with Symfony 5 (https://github.com/api-platform/core/pull/3009)

Commits
-------

e819256ea0 [HttpFoundation] Allow to not pass a parameter to Request::isMethodSafe()
2019-10-29 14:51:20 +01:00
Kévin Dunglas
e819256ea0 [HttpFoundation] Allow to not pass a parameter to Request::isMethodSafe() 2019-10-29 14:51:13 +01:00
Thomas Calvet
ad2ce276c7 [Serializer] Improve messages for unexpected resources values 2019-10-29 12:09:57 +01:00
Kévin Dunglas
ee4b99f227
bug #33828 [DoctrineBridge] Auto-validation must work if no regex are passed (dunglas)
This PR was squashed before being merged into the 4.3 branch (closes #33828).

Discussion
----------

[DoctrineBridge] Auto-validation must work if no regex are passed

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

Backport of https://github.com/symfony/symfony/pull/32107/files#r295762928.
This behavior if faulty, if no regex are passed, autvalidation must be triggered, [as done in `PropertyInfoLoader`](https://github.com/symfony/symfony/blob/4.3/src/Symfony/Component/Validator/Mapping/Loader/PropertyInfoLoader.php#L50).

Commits
-------

5ed7d6c759 [DoctrineBridge] Auto-validation must work if no regex are passed
2019-10-29 11:03:42 +01:00
Kévin Dunglas
5ed7d6c759
[DoctrineBridge] Auto-validation must work if no regex are passed 2019-10-29 11:03:05 +01:00
Robin Chalas
f233259c68 remove outdated workflow test 2019-10-29 03:10:02 +01:00
Robin Chalas
6c2253415f drop wrong test (fix merge) 2019-10-29 02:54:26 +01:00
Glodzienski
16bd71b5b1
Adding some validations tags on validators.et.xlf 2019-10-28 21:40:18 -03:00
Nicolas Grekas
7b3d5cd615 minor #34157 [OptionsResolver] Fix an error message to be more accurate (yceruto)
This PR was merged into the 4.3 branch.

Discussion
----------

[OptionsResolver] Fix an error message to be more accurate

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

Follow-up https://github.com/symfony/symfony/pull/30442 for 4.3

Commits
-------

1be68a752a Fix an error message to be more accurate
2019-10-28 22:53:11 +01:00
Yonel Ceruto
1be68a752a Fix an error message to be more accurate 2019-10-28 16:59:01 -04:00
Robin Chalas
2ecd7936b1 bug #34080 [SecurityBundle] correct types for default arguments for firewall configs (shieldo)
This PR was merged into the 3.4 branch.

Discussion
----------

[SecurityBundle] correct types for default arguments for firewall configs

| Q             | A
| ------------- | ---
| Branch?       | 3.4 (and forward)
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | n/a
| License       | MIT
| Doc PR        | n/a

Up until now, the default template arguments in the `security.firewall.config` abstract service definition have been each defined (aside from the argument for `$listeners` which is given a `collection` type) in the XML as

```xml
<argument />
```

which resolves to an empty string, despite that some of the arguments are typed to being either `bool` or `array|null` on the `Symfony\Bundle\SecurityBundle\Security\FirewallConfig` class itself.

This wouldn't be so much of a problem if the child definitions that use this as a template overrode all the arguments every time, but in the case of firewall configs that mark security as _not_ being enabled, [only the first few arguments are overwritten](https://github.com/symfony/symfony/blob/3.4/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php#L349-L352), so firewall config objects that do not have security enabled are instantiated by the DI container with parameters with some of the wrong types.

In general this wouldn't be an issue, as firewalls with security not enabled would not usually be consumed in a context where further security-related config were needed, but there is a case in `Symfony\Bundle\SecurityBundle\DataCollector\SecurityDataCollector` where the method `getSwitchUser()` on the firewall config object [can be called](https://github.com/symfony/symfony/blob/3.4/src/Symfony/Bundle/SecurityBundle/DataCollector/SecurityDataCollector.php#L181) without checking first whether the firewall has security enabled, which leads to an exception being thrown:

```
Symfony\Component\Debug\Exception\ContextErrorException
Warning: Illegal string offset 'parameter'
in vendor/symfony/symfony/src/Symfony/Bundle/SecurityBundle/DataCollector/SecurityDataCollector.php (line 184)
```

which is down to the firewall config being set with an empty string rather than `null` (in which case the logic here would function as expected).

It seemed most appropriate as a fix (especially given possible introduction of scalar type hints in the future) to apply types to the default arguments so that it was no longer possible to instantiate a firewall config object with parameters of unexpected types.

<!--
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
-------

6b7044fc01 [SecurityBundle] correct types for default arguments for firewall configs
2019-10-28 18:20:44 +01:00
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
Massimiliano Arione
1dc7ce1159
add missing translation for 94 (it) 2019-10-28 16:39:28 +01:00