Commit Graph

48398 Commits

Author SHA1 Message Date
Nicolas Grekas f4a02b4603 bug #39420 [Cache] Prevent notice on case matching metadata trick (bastnic)
This PR was submitted for the 5.1 branch but it was merged into the 4.4 branch instead.

Discussion
----------

[Cache] Prevent notice on case matching metadata trick

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

On saving an array of one element with a int key of strlen 10
it matches the first conditions of the trick used to save metadata.

> Notice: Trying to access array offset on value of type int

Casting it to string fixes it.

Commits
-------

a91ac74906 [Cache] Prevent notice on case matching metadata trick
2020-12-10 08:50:58 +01:00
Bastien Jaillot a91ac74906 [Cache] Prevent notice on case matching metadata trick
On saving an array of one element with a int key of strlen 10
it matches the first conditions of the trick used to save metadata.

> Notice: Trying to access array offset on value of type int

Casting it to string fixes it.
2020-12-10 08:50:50 +01:00
Fabien Potencier 2dd4561d3f bug #39203 [DI] Fix not working if only "default_index_method" used (malteschlueter)
This PR was merged into the 4.4 branch.

Discussion
----------

[DI] Fix not working if only "default_index_method" used

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

The default index method wasn't used if the "index_by" attribute is missing. The documentation is showing an example, see https://symfony.com/doc/current/service_container/tags.html#tagged-services-with-index.

This problem also appears in symfony 5.

I created two example projects, the first in the current behaviour and the second with my bugfix branch.

Current 4.4: https://github.com/malteschlueter/symfony-reproducers/blob/bugfix/dependency-injection-default-index-method-not-working--not-fixed/tests/HandlerCollectionTest.php

This bugfix branch: https://github.com/malteschlueter/symfony-reproducers/blob/bugfix/dependency-injection-default-index-method-not-working--with-fix/tests/HandlerCollectionTest.php

Commits
-------

eb25d5c275 [DI] The default index method wasn't used if the "index_by" attribute is missing
2020-12-10 08:05:48 +01:00
Nicolas Grekas 52a0233905 [PhpUnitBridge] CS fix 2020-12-09 19:44:45 +01:00
Alexander M. Turek 75b094cdbb minor #39418 [PhpUnitBridge] Fix PHP 5.5 compatibility (fancyweb)
This PR was merged into the 4.4 branch.

Discussion
----------

[PhpUnitBridge] Fix PHP 5.5 compatibility

| Q             | A
| ------------- | ---
| Branch?       |4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | cf620b6eb3 (commitcomment-44884087)
| License       | MIT
| Doc PR        | -

Thanks to @maximium for spotting it.

Commits
-------

fe7abcd1e9 [PhpUnitBridge] Fix PHP 5.5 compatibility
2020-12-09 18:10:44 +01:00
Thomas Calvet fe7abcd1e9 [PhpUnitBridge] Fix PHP 5.5 compatibility 2020-12-09 17:54:32 +01:00
Alexander M. Turek 0676399b88 minor #39398 [ErrorHandler][HttpKernel] Add missing param annotation for $fileLinkFormat (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[ErrorHandler][HttpKernel] Add missing param annotation for $fileLinkFormat

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

Commits
-------

32a56a6389 Add missing param annotation abouts $fileLinkFormat
2020-12-09 14:20:21 +01:00
Nicolas Grekas 32a56a6389 Add missing param annotation abouts $fileLinkFormat 2020-12-09 12:15:38 +01:00
Nicolas Grekas 55d2723c84 bug #39142 [Config] Stop treating multiline resources as globs (michaelKaefer)
This PR was merged into the 4.4 branch.

Discussion
----------

[Config] Stop treating multiline resources as globs

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

Would fix the linked issue.

In https://github.com/symfony/symfony/issues/22938 it was suggested to enhance the glob-detection logic by detecting newlines.

Cons:
- it only solves an edge case
- it is not possible to use a multiline glob (like `bar\nbaz*.txt`) as a resource anymore - maybe in another edge case this is needed

Commits
-------

1e3baad386 23412 Stop treating multiline resources as globs
2020-12-09 09:58:17 +01:00
Alexander M. Turek 558ce1b4d3 bug #39341 [Form] Fixed StringUtil::trim() to trim ZERO WIDTH SPACE (U+200B) and SOFT HYPHEN (U+00AD) (pmishev)
This PR was merged into the 4.4 branch.

Discussion
----------

[Form] Fixed StringUtil::trim() to trim ZERO WIDTH SPACE (U+200B) and SOFT HYPHEN (U+00AD)

| 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       | Fix #39230 <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| 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/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
-------

258bea7fd5 [Form] Fixed StringUtil::trim() to trim ZERO WIDTH SPACE (U+200B) and SOFT HYPHEN (U+00AD)
2020-12-08 18:57:51 +01:00
Nicolas Grekas 236400c03a [PhpUnitBridge] Fix CS for PHP 5.5 2020-12-08 18:05:36 +01:00
Nicolas Grekas 018415e194 Update .php_cs.dist 2020-12-08 18:00:58 +01:00
Nicolas Grekas ff22d30cb0 Apply "visibility_required" CS rule to constants
php-cs-fixer fix --rules='{"visibility_required": ["property", "method", "const"]}'
2020-12-08 17:59:59 +01:00
Malte Schlüter eb25d5c275 [DI] The default index method wasn't used if the "index_by" attribute is missing 2020-12-08 17:11:59 +01:00
Nicolas Grekas a7fcb0b84e minor cs fix 2020-12-08 15:13:31 +01:00
Alexander M. Turek 8f331f2df2 bug #39334 [Config][TwigBundle] Fixed syntax error in config (Nyholm)
This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

[Config][TwigBundle] Fixed syntax error in config

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

Sorry for such small PR. I found this when I was parsing the yaml after running `bin/console config:dump-reference TwigBundle`

#SymfonyHackday

Commits
-------

04d369d336 [Config][TwigBundle] Fixed syntax error in config
2020-12-08 15:10:36 +01:00
Nyholm 04d369d336 [Config][TwigBundle] Fixed syntax error in config 2020-12-08 15:10:25 +01:00
Nicolas Grekas 891e2afb64 bug #39196 [DI] Fix Xdebug 3.0 detection (vertexvaar)
This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

[DI] Fix Xdebug 3.0 detection

| Q             | A
| ------------- | ---
| Branch?       | 4.4 (for bug fixes)
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #39195
| License       | MIT
| Doc PR        | n/a

Xdebug 3.0 removed the function `xdebug_is_enabled()`. To detect if Xdebug 3.0 is installed (it doesn't even need to be enabled to reproduce the bug) i added `function_exists('xdebug_info')`. AFAIS `xdebug_info()` is available in Xdebug >= 3.0 only.

Commits
-------

38f8edddb1 [DI] Fix Xdebug 3.0 detection
2020-12-08 15:03:26 +01:00
Oliver Eglseder 38f8edddb1 [DI] Fix Xdebug 3.0 detection 2020-12-08 15:03:00 +01:00
Nicolas Grekas e4e3b454e5 minor #39385 Use php8 stable (OskarStark)
This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

Use php8 stable

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

This is only part of the development pipeline and should be considered a bugfix, thats why I target `4.4` branch.

Commits
-------

570e75f7cd Use php8 stable
2020-12-08 14:47:09 +01:00
Oskar Stark 570e75f7cd Use php8 stable 2020-12-08 14:47:02 +01:00
Nicolas Grekas cba70a6547 bug #39226 [PhpUnitBridge] Fix disabling DeprecationErrorHandler from PHPUnit configuration file (fancyweb)
This PR was merged into the 4.4 branch.

Discussion
----------

[PhpUnitBridge] Fix disabling DeprecationErrorHandler from PHPUnit configuration file

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

The linked issue description is right, the bridge's bootstrap is hit before the env variables from the phpunit.xml file are read and set. So the easiest solution is to read it ourselves in the root script (like we already do for some of them).

Commits
-------

41158b8878 [PhpUnitBridge] Fix disabling DeprecationErrorHandler from phpunit configuration file
2020-12-08 12:21:32 +01:00
Nicolas Grekas 1ea5a8c3ce minor #39246 [HttpFoundation] Throws cleanup (kick-the-bucket)
This PR was merged into the 4.4 branch.

Discussion
----------

[HttpFoundation] Throws cleanup

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

The actual throw statements have been removed years ago, but the annotations stayed.
Such annotations fool static analysis tools to trigger false positives for unhandled exceptions.

Commits
-------

8b9b62048c Remove unused @throws tags and handling of never thrown exceptions
2020-12-08 12:12:36 +01:00
Nicolas Grekas bd44eb69a2 [Cache] fix checking for redis_sentinel support 2020-12-08 11:44:58 +01:00
Fabien Potencier 75a863d4c2 minor #39371 [Intl] Update the ICU data to 68.1 (jakzal)
This PR was merged into the 4.4 branch.

Discussion
----------

[Intl] Update the ICU data to 68.1

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

Ideally, this should be merged after #39370.

Commits
-------

f3eda44058 [Intl] Update the ICU data to 68.1
2020-12-08 10:54:41 +01:00
Jakub Zalas f3eda44058
[Intl] Update the ICU data to 68.1 2020-12-08 08:18:40 +00: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
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
Nicolas Grekas 6ecae5719c [FrameworkBundle] fix preserving some special chars in the query string when redirecting 2020-12-07 13:08:17 +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
pmishev 258bea7fd5 [Form] Fixed StringUtil::trim() to trim ZERO WIDTH SPACE (U+200B) and SOFT HYPHEN (U+00AD) 2020-12-05 20:51:30 +00: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
Nyholm 9104fd4539
[Config] YamlReferenceDumper: No default value required for VariableNode with array example 2020-12-05 17:41:45 +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
Łukasz Chruściel 41b9457887 [Test] Reproduce issue with cascading validation 2020-12-05 16:10:06 +01:00