Commit Graph

52243 Commits

Author SHA1 Message Date
Nicolas Grekas
5f08c617cd bug #39298 [Cache] Fixed incorrect usage of UNLINK with PHPRedis with Redis < 4.0 (wickex)
This PR was merged into the 5.2 branch.

Discussion
----------

[Cache] Fixed incorrect usage of UNLINK with PHPRedis with Redis < 4.0

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

Currently, deleting cache keys is broken for users using PhpRedis with Redis-server < 4.0.0. The current implementation expects PhpRedis to throw an exception if the 'unlink'-function is used but unavailable, after which it's supposed to switch to using the 'del'-function. Using the 'unlink'-function on lower Redis-server versions seems to not throw an exception, but instead it appears to silently fail.

This pull request changes this behavior and checks the Redis-server version instead. If the version is 4.0 or higher, it uses the unlink function. If not, it uses the del-function.

Also see https://redis.io/commands/unlink > "Available since 4.0.0".

(Footnote: this is one of my first times contributing to an open-source project and my first time contributing to Symfony. I've tried following the guidelines, but please let me know if I missed anything. I'm unsure how I would go about unit testing this specific bugfix due to it being dependent on the Redis version, so I omitted it. Please let me know if a unit test is indeed required for this and if so, let me know if you have any suggestions on how to go about that.)

Commits
-------

9363f3b973 [Cache] Fixed incorrect usage of UNLINK with PHPRedis with Redis < 4.0
2020-12-08 12:05:08 +01:00
Wickex
9363f3b973 [Cache] Fixed incorrect usage of UNLINK with PHPRedis with Redis < 4.0 2020-12-08 12:04:54 +01:00
Fabien Potencier
fd34c9c22f bug #39358 [HttpFoundation] fix parsing some special chars with HeaderUtils::parseQuery() (nicolas-grekas)
This PR was merged into the 5.2 branch.

Discussion
----------

[HttpFoundation] fix parsing some special chars with HeaderUtils::parseQuery()

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

Same as #39357 for 5.2

Commits
-------

8682bdc521 [HttpFoundation] fix parsing some special chars with HeaderUtils::parseQuery()
2020-12-08 08:08:22 +01:00
Fabien Potencier
f4e1556199 Merge branch '5.1' into 5.2
* 5.1:
  [Serializer] Fixed serialize and denormalize return types
  Run intl-data tests on resources change
  [FrameworkBundle] fix preserving some special chars in the query string when redirecting
2020-12-08 08:07:34 +01:00
Fabien Potencier
dde0f3c999 Merge branch '4.4' into 5.1
* 4.4:
  Run intl-data tests on resources change
  [FrameworkBundle] fix preserving some special chars in the query string when redirecting
2020-12-08 08:06:06 +01:00
Fabien Potencier
a630685da1 bug #39357 [FrameworkBundle] fix preserving some special chars in the query string (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[FrameworkBundle] fix preserving some special chars in the query string

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

Commits
-------

6ecae5719c [FrameworkBundle] fix preserving some special chars in the query string when redirecting
2020-12-08 08:04:52 +01:00
Fabien Potencier
7668a1e826 minor #39370 Run intl-data tests on resources change (jakzal)
This PR was merged into the 4.4 branch.

Discussion
----------

Run intl-data tests on resources change

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

`intl-data` tests are run whenever we update ICU data as they're rather time-consuming.

This proposal automates intl-data test runs with Github Actions. Tests will only be run on pull requests or pushes that modifyy ICU data. Full run on Github Actions takes 6-7mins. Example run: https://github.com/jakzal/symfony/actions/runs/406526765

<img width="1204" alt="image" src="https://user-images.githubusercontent.com/190447/101393171-92a28c00-38be-11eb-9efa-8f0a75ff04b0.png">

Commits
-------

745020892f Run intl-data tests on resources change
2020-12-08 07:37:22 +01:00
Fabien Potencier
7652685ec1 minor #39337 [Serializer] Fixed serialize and denormalize return types (vudaltsov)
This PR was squashed before being merged into the 5.1 branch.

Discussion
----------

[Serializer] Fixed serialize and denormalize return types

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

Since #35235 `SerializerInterface::deserialize()` and `DenormalizerInterface::denormalize()` return types are no longer correct.

I suggest using `mixed` to allow custom denormalizers to denormalize to any type. For instance, I might add `ClosureDenormalizer` or `NullDenormalizer` or `ResourceDenormalizer`, technically there are no limits.

Commits
-------

67277e55f0 [Serializer] Fixed serialize and denormalize return types
2020-12-08 07:28:58 +01:00
vudaltsov
67277e55f0 [Serializer] Fixed serialize and denormalize return types 2020-12-08 07:28:50 +01:00
Fabien Potencier
619d54389e bug #39310 [Notifier] Add exception for deprecated slack dsn (malteschlueter)
This PR was merged into the 5.2 branch.

Discussion
----------

[Notifier] Add exception for deprecated slack dsn

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

The DSN for the Slack integration changed again from 5.1 to 5.2. There was the idea to output an exception for that.

Commits
-------

6b56b4c6f9 [Notifier] Add exception for deprecated slack dsn
2020-12-08 07:26:38 +01:00
Alexander M. Turek
cd3993ee88 Merge branch '5.1' into 5.2
* 5.1:
  [HttpFoundation] Removed obsolete test.
  [HttpFoundation] Fix TypeError: Argument 1 passed to JsonResponse::setJson() must be of the type string, object given
  [Security][Validator] Add missing Portuguese translations
  Add Croatian (hr) translations
2020-12-07 23:32:31 +01:00
Alexander M. Turek
2807a7950d [HttpFoundation] Removed obsolete test. 2020-12-07 23:31:01 +01:00
Alexander M. Turek
f8b9ee9333 Merge branch '4.4' into 5.1
* 4.4:
  [HttpFoundation] Fix TypeError: Argument 1 passed to JsonResponse::setJson() must be of the type string, object given
  [Security][Validator] Add missing Portuguese translations
  Add Croatian (hr) translations
2020-12-07 23:18:25 +01:00
Alexander M. Turek
306914a96d bug #39271 [HttpFoundation] Fix TypeError: Argument 1 passed to JsonResponse::setJson() must be of the type string, object given (sidz)
This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

[HttpFoundation] Fix TypeError: Argument 1 passed to JsonResponse::setJson() must be of the type string, object given

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

This PR fixes the type error when user set `null` as data in the `new JsonResponse(null, 200, [], true)` and true in the fourth argument to mark that value is json.
```
TypeError: Argument 1 passed to Symfony\Component\HttpFoundation\JsonResponse::setJson() must be of the type string, object given, called in /home/projects/symfony/src/Symfony/Component/HttpFoundation/JsonResponse.php on line 52
```

Commits
-------

7fcba9611d [HttpFoundation] Fix TypeError: Argument 1 passed to JsonResponse::setJson() must be of the type string, object given
2020-12-07 23:02:04 +01:00
Oleg Zhulnev
7fcba9611d [HttpFoundation] Fix TypeError: Argument 1 passed to JsonResponse::setJson() must be of the type string, object given 2020-12-07 23:01:57 +01:00
Jakub Zalas
745020892f
Run intl-data tests on resources change 2020-12-07 20:17:10 +00:00
Alexander M. Turek
6df4b04165 minor #39366 Fix: Indentation (OskarStark)
This PR was merged into the 5.2 branch.

Discussion
----------

Fix: Indentation

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

Commits
-------

37fddad0f2 Fix: Indentation
2020-12-07 17:06:35 +01:00
Alexander M. Turek
fb87cf4b71 minor #39367 [Notifier] Fix: Remove unused sprintf() parameters (OskarStark)
This PR was merged into the 5.2 branch.

Discussion
----------

[Notifier] Fix: Remove unused sprintf() parameters

| Q             | A
| ------------- | ---
| Branch?       | 5.2
| 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        | ---

Commits
-------

c0dda8bd03 Fix: Remove unused sprintf() parameters
2020-12-07 16:48:24 +01:00
Malte Schlüter
6b56b4c6f9 [Notifier] Add exception for deprecated slack dsn 2020-12-07 16:39:20 +01:00
Oskar Stark
37fddad0f2 Fix: Indentation 2020-12-07 16:02:25 +01:00
Oskar Stark
c0dda8bd03 Fix: Remove unused sprintf() parameters 2020-12-07 16:01:25 +01:00
Nicolas Grekas
6ecae5719c [FrameworkBundle] fix preserving some special chars in the query string when redirecting 2020-12-07 13:08:17 +01:00
Nicolas Grekas
8682bdc521 [HttpFoundation] fix parsing some special chars with HeaderUtils::parseQuery() 2020-12-07 13:06:47 +01:00
Alexander M. Turek
03a072e07c minor #39345 [Security][Validator] Add missing Portuguese translations (NicolasJourdan)
This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

[Security][Validator] Add missing Portuguese translations

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

Commits
-------

ad4f6f2093 [Security][Validator] Add missing Portuguese translations
2020-12-07 10:01:52 +01:00
Nicolas Jourdan
ad4f6f2093 [Security][Validator] Add missing Portuguese translations 2020-12-07 10:01:46 +01:00
Alexander M. Turek
4404e6a3e9 minor #39332 Add Croatian (hr) translations (jseparovic1)
This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

Add Croatian (hr) translations

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

#SymfonyHackday

Commits
-------

f2dbbd2e58 Add Croatian (hr) translations
2020-12-07 10:00:22 +01:00
Jurica Šeparović
f2dbbd2e58 Add Croatian (hr) translations 2020-12-07 10:00:14 +01:00
Fabien Potencier
937c403f15 minor #39343 Add missing entries in gitattributes (jderusse)
This PR was merged into the 5.2 branch.

Discussion
----------

Add missing entries in gitattributes

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

Adds `/.gitattributes export-ignore` in some bridges

Commits
-------

36f5ff1550 Add missing entries in gitattributes
2020-12-06 08:20:53 +01:00
Jérémy Derussé
36f5ff1550
Add missing entries in gitattributes 2020-12-05 23:16:05 +01:00
Alexander M. Turek
09567d9990 minor #39338 [Notifier] Fix tests with PHPUnit 9.5 (derrabus)
This PR was merged into the 5.2 branch.

Discussion
----------

[Notifier] Fix tests with PHPUnit 9.5

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

Follow-up to #39331, #39335.

#SymfonyHackday

Commits
-------

cb66c523fe [Notifier] Fix tests with PHPUnit 9.5.
2020-12-05 20:09:42 +01:00
Alexander M. Turek
cb66c523fe [Notifier] Fix tests with PHPUnit 9.5. 2020-12-05 19:56:23 +01:00
Alexander M. Turek
dbc1db21cd Merge branch '5.1' into 5.2
* 5.1:
  Fix merge.
  Fix CS
  [Messenger] Test generated SQL
  [Config] YamlReferenceDumper: No default value required for VariableNode with array example
  Remove PHPUnit configuration files from components without tests.
  [DependencyInjection] Fix container linter for union types.
2020-12-05 19:32:58 +01:00
Alexander M. Turek
7c31fa0537 Fix merge. 2020-12-05 19:20:45 +01:00
Alexander M. Turek
f13821e881 Merge branch '4.4' into 5.1 2020-12-05 18:55:33 +01:00
Fabien Potencier
bda2dcdf93 bug #39251 [DependencyInjection] Fix container linter for union types (derrabus)
This PR was merged into the 4.4 branch.

Discussion
----------

[DependencyInjection] Fix container linter for union types

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

Commits
-------

e26893b122 [DependencyInjection] Fix container linter for union types.
2020-12-05 18:12:03 +01:00
Alexander M. Turek
cf07627956 minor #39214 [Messenger] Test generated SQL (derrabus)
This PR was merged into the 4.4 branch.

Discussion
----------

[Messenger] Test generated SQL

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

Follow-up to #39166.

This is an attempt to the SQL generated by the `Symfony\Component\Messenger\Transport\Doctrine\Connection::get()` method. The challange was to create a locking SELECT statement, taking into account the different ways to create a lock in different SQL dialects.

This test verifies if the correct lock statements are generated for MySQL and SQL Server.

Commits
-------

1f1b62afb6 [Messenger] Test generated SQL
2020-12-05 18:10:39 +01:00
Fabien Potencier
fd3c60b315 Fix CS 2020-12-05 18:09:55 +01:00
Alexander M. Turek
1f1b62afb6 [Messenger] Test generated SQL 2020-12-05 18:08:48 +01:00
Fabien Potencier
1f6f693aa5 bug #39336 [Config] YamlReferenceDumper: No default value required for VariableNode with array example (Nyholm)
This PR was merged into the 4.4 branch.

Discussion
----------

[Config] YamlReferenceDumper: No default value required for VariableNode with array example

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

This will fix #39328 in a better way.

A `VariableNode` may have an array as value and also a default value as "null". (Like the workflow component).
When we dump the config, we generate invalid yaml:

```
    workflows:
        enabled:              false
        workflows:
            # Prototype
            name:
                # Select which Transition events should be dispatched for this Workflow
                events_to_dispatch:   null

                    # Examples:
                    - workflow.enter
                    - workflow.transition

```

With this PR, we will remove the `null` default value from the dumped config.

#SymfonyHackday

Commits
-------

9104fd4539 [Config] YamlReferenceDumper: No default value required for VariableNode with array example
2020-12-05 18:07:51 +01:00
Fabien Potencier
3eb73efc34 minor #39335 [Notifier] Remove PHPUnit configuration files from components without tests (derrabus)
This PR was merged into the 5.1 branch.

Discussion
----------

[Notifier] Remove PHPUnit configuration files from components without tests

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

Follows #39331 by @wouterj.

PHPUnit 9.5 fails if we look for tests in directories that do not exist. This is very reasonable behavior, imho.

However, we do have some bridges in the Notifier component that don't provide any tests. Running PHPUnit on those bridges is pointless, which is why I'd like to remove the PHPUnit configuration from them. We can re-add the files as soon as we add tests.

#SymfonyHackday

Commits
-------

710340dfb2 Remove PHPUnit configuration files from components without tests.
2020-12-05 18:06:53 +01:00
Nyholm
9104fd4539
[Config] YamlReferenceDumper: No default value required for VariableNode with array example 2020-12-05 17:41:45 +01:00
Alexander M. Turek
710340dfb2 Remove PHPUnit configuration files from components without tests. 2020-12-05 17:36:14 +01:00
Fabien Potencier
2f607dea7d Merge branch '5.1' into 5.2
* 5.1:
  [Messenger] StopWorkersCommand improve doc helper
  Added compatibility with PHPunit 9.5
  do not apply the Valid constraint on scalar form data
  [Test] Reproduce issue with cascading validation
  [SecurityBundle] Don't use the container as resource type in fixtures.
  Fix bug with whitespace in Kernel::stripComments()
2020-12-05 17:05:27 +01:00
Fabien Potencier
7e577b9cd9 Merge branch '4.4' into 5.1
* 4.4:
  [Messenger] StopWorkersCommand improve doc helper
  Added compatibility with PHPunit 9.5
  do not apply the Valid constraint on scalar form data
  [Test] Reproduce issue with cascading validation
  [SecurityBundle] Don't use the container as resource type in fixtures.
  Fix bug with whitespace in Kernel::stripComments()
2020-12-05 17:05:09 +01:00
Fabien Potencier
21ef411cc9 bug #39333 [Form] do not apply the Valid constraint on scalar form data (lchrusciel, xabbuh)
This PR was merged into the 4.4 branch.

Discussion
----------

[Form] do not apply the Valid constraint on scalar form data

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

#SymfonyHackday

Commits
-------

453bb3ebde do not apply the Valid constraint on scalar form data
41b9457887 [Test] Reproduce issue with cascading validation
2020-12-05 17:02:18 +01:00
Fabien Potencier
935495868a bug #39331 [PhpUnitBridge] Fixed PHPunit 9.5 compatibility (wouterj)
This PR was merged into the 4.4 branch.

Discussion
----------

[PhpUnitBridge] Fixed PHPunit 9.5 compatibility

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

Let's see if this works 🍀

#SymfonyHackday

Commits
-------

5134de52f1 Added compatibility with PHPunit 9.5
2020-12-05 16:57:56 +01:00
Fabien Potencier
d0d0ee3c4f minor #39217 [Messenger] StopWorkersCommand improve doc helper (94noni)
This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

[Messenger] StopWorkersCommand improve doc helper

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

Small improvement :)

Commits
-------

e136068743 [Messenger] StopWorkersCommand improve doc helper
2020-12-05 16:51:46 +01:00
Antoine Makdessi
e136068743 [Messenger] StopWorkersCommand improve doc helper 2020-12-05 16:51:39 +01:00
Wouter de Jong
5134de52f1 Added compatibility with PHPunit 9.5 2020-12-05 16:15:30 +01:00
Christian Flothmann
453bb3ebde do not apply the Valid constraint on scalar form data 2020-12-05 16:10:06 +01:00