This PR was squashed before being merged into the 5.3-dev branch.
Discussion
----------
LoginLink create get Request Locale
| Q | A
| ------------- | ---
| Branch? | 5.x
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| License | MIT
| Doc PR | symfony/symfony-docs#15163
While writing the documentation for PR#40153 I noticed that the RequestContext :: fromRequest method does not add the '_locale' parameter automaticaly. This new pull request to set _locale parameter to the RequestContext.
Commits
-------
433d76bfe1 LoginLink create get Request Locale
* 5.2:
fixed parser
Fixed bugs found by psalm
[FrameworkBundle] Dont store cache misses on warmup
fix test
Update references to the ContainerConfigurator
[Translation] Remove file added back from a bad merge
Fix sleep value
[Cache] skip storing failure-to-save as misses in ArrayAdapter
[Validator] Delete obsolete statement in Regex::getHtmlPattern() phpDoc
[FrameworkBundle] Remove author comments for configuration and extension
[Stopwatch] Document new "name" property of StopwatchEvent
[DependencyInjection] Fix "url" env var processor behavior when the url has no path
Fixed support for nodes not extending BaseNode
[FrameworkBundle] dont access the container to configure http_cache
add missing queue_name to find(id) in doctrine messenger transport
[Config][FrameworkBundle] Hint to use PHP 8+ or to install Annotations to use attributes/annots
[Serializer] AbstractNormalizer force null for non-optional nullable constructor parameter denormalization when not present in input
* 4.4:
fixed parser
Fixed bugs found by psalm
[FrameworkBundle] Dont store cache misses on warmup
[Cache] skip storing failure-to-save as misses in ArrayAdapter
[Validator] Delete obsolete statement in Regex::getHtmlPattern() phpDoc
[FrameworkBundle] Remove author comments for configuration and extension
[DependencyInjection] Fix "url" env var processor behavior when the url has no path
Fixed support for nodes not extending BaseNode
add missing queue_name to find(id) in doctrine messenger transport
[Serializer] AbstractNormalizer force null for non-optional nullable constructor parameter denormalization when not present in input
This PR was squashed before being merged into the 4.4 branch.
Discussion
----------
Fixed bugs found by psalm
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets |
| License | MIT
| Doc PR |
When running psalm for branch 4.4, we get around 1500 errors. I browsed though them all and here is a small PR with the actual bugs I think should be fixed.
I'll make review comments about them below.
Commits
-------
0a0cd7a274 Fixed bugs found by psalm
This PR was merged into the 4.4 branch.
Discussion
----------
[Config] Fixed support for nodes not extending BaseNode
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets |
| License | MIT
| Doc PR |
Too many times we assume that a `NodeInterface` extends `BaseNode`. This PR adds a small test with a new `CustomNodeDefinition` and `CustomNode` that implements `NodeInterface`.
Commits
-------
68276562c3 Fixed support for nodes not extending BaseNode
This PR was squashed before being merged into the 4.4 branch.
Discussion
----------
[FrameworkBundle] Dont store cache misses on warmup
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#38694
| License | MIT
| Doc PR | symfony/symfony-docs#15172
When we are warming the annotation cache, we are reading all annotation into an `ArrayAdapter`. When we are done we move the values to a `PhpArrayAdapter` to store them in a file.
@Seldaek [found out](https://github.com/symfony/symfony/issues/38694#issuecomment-810501066) that when you are using a custom constraint with a `Symfony\Component\Validator\Constraints\Callback`, there is a strange error like:
> Can use "yield from" only with arrays and Traversables
That is because the `Closure` in the `Symfony\Component\Validator\Constraints\Callback` cannot be serialised and saved to cache. But since the `ArrayAdapter` is also [storing misses as null](https://github.com/symfony/symfony/pull/35362), the null values are understood as real values.
When all values are moved to the `PhpArrayAdapter` and we ask the cache for a value (via Doctrine's `CacheProvider`), it will return `null` as a value instead of `false` as a cache miss. And `null` is not something one could "yield from".
Commits
-------
27a22b34af [FrameworkBundle] Dont store cache misses on warmup
This PR was merged into the 5.2 branch.
Discussion
----------
[FrameworkBundle] fix test
| Q | A
| ------------- | ---
| Branch? | 5.2
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | Fix#40668
| License | MIT
| Doc PR |
Commits
-------
3de5b38cea fix test
This PR was squashed before being merged into the 5.3-dev branch.
Discussion
----------
Improve ExtractorInterface phpdoc
| Q | A
| ------------- | ---
| Branch? | 5.x
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| 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.
- Changelog entry should follow https://symfony.com/doc/current/contributing/code/conventions.html#writing-a-changelog-entry
-->
I think this phpdoc can be improved
Commits
-------
255b608d6d Improve ExtractorInterface phpdoc
This PR was merged into the 5.3-dev branch.
Discussion
----------
Doc: Fix unclosed backtick in UPGRADE-6.0.md
Fix unclosed backtick.
| Q | A
| ------------- | ---
| Branch? | 5.x for features / 4.4 or 5.2 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.
- Changelog entry should follow https://symfony.com/doc/current/contributing/code/conventions.html#writing-a-changelog-entry
-->
Commits
-------
c4c79662db Update UPGRADE-6.0.md
This PR was submitted for the 5.x branch but it was merged into the 5.2 branch instead.
Discussion
----------
Update references to the ContainerConfigurator
follows: e4598c2b4f
| Q | A
| ------------- | ---
| Branch? | 5.x <!-- 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 -->
| 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.
- Changelog entry should follow https://symfony.com/doc/current/contributing/code/conventions.html#writing-a-changelog-entry
-->
Commits
-------
6990829c2e Update references to the ContainerConfigurator
This PR was merged into the 4.4 branch.
Discussion
----------
[FrameworkBundle] Remove author comments for configuration and extension
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets |
| License | MIT
| Doc PR |
I really don't want to step on anyones toes. I'm also super grateful for all the time, effort and energy these contributors (and everybody else) have given to Symfony.
The `@author` tags should represent "who knows the most about this class" or to give the original author some kind of credit (more visible than `git blame`).
The FrameworkBundle's `Configuration` and `FrameworkExtension` classes are a bit special. Fist because they are well known by most recurring contributors. They are also thousands of lines long and many many users have added a line or two. The `FrameworkExtension` have over 50 people that currently authored more than 5 lines. The named authors combined have about that 12% and 25% in `Configuration` and `FrameworkExtension` respectively.
I do like the `@author` tag, but for the reasons above, I don't think they make sense for these classes.
Commits
-------
f19d72aa07 [FrameworkBundle] Remove author comments for configuration and extension
This PR was merged into the 5.3-dev branch.
Discussion
----------
Use symfony/deprecation-contracts instead of trigger_error
| Q | A
| ------------- | ---
| Branch? | 5.x
| Bug fix? | no
| New feature? | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | yes <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets | - <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License | MIT
| Doc PR | - <!-- required for new features -->
As `symfony/deprecation-contracts` added to requirements with PR #40468, we can update `trigger_error` call in favor reusing deprecation abstractions
Commits
-------
1acc296773 Use symfony/deprecation-contracts instead of trigger_error
This PR was merged into the 4.4 branch.
Discussion
----------
[Validator] Delete obsolete statement in Regex::getHtmlPattern() phpDoc
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | #12235
| License | MIT
| Doc PR |
The original issue was #5307 (`match=false` not handled in `getHtmlPattern()`).
Then #5382 patched it to return null (rather than an incorrect result) and inserted a statement and a "todo" in the phpDoc.
Later (but still years ago) #12235 properly implemented pattern inversion, but only removed the "todo"; this PR removes the statement.
Commits
-------
3bdf8d7238 [Validator] Delete obsolete statement in Regex::getHtmlPattern() phpDoc
This PR was merged into the 4.4 branch.
Discussion
----------
[DependencyInjection] Fix "url" env var processor behavior when the url has no path
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
Before:
```yaml
MY_URL_ENV_VAR=http://symfony.com
%env(key:path:url:MY_URL_ENV_VAR)% --> false
```
After:
```yaml
MY_URL_ENV_VAR=http://symfony.com
%env(key:path:url:MY_URL_ENV_VAR)% --> null
```
Returning `false` for the path prevents me from using the `default` env var processor that is triggered only for `''` and `null`.
(`%env(default:my_fallback_param:key:path:url:MY_URL_ENV_VAR)%`)
BTW, with PHP 8, it actually works because `substr(null, 1)` behavior changed (see https://3v4l.org/oHf6l).
Commits
-------
2876cf9cc6 [DependencyInjection] Fix "url" env var processor behavior when the url has no path
This PR was merged into the 4.4 branch.
Discussion
----------
[Cache] skip storing failure-to-save as misses in ArrayAdapter
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#38694
| License | MIT
| Doc PR | -
In addition to #40645
Commits
-------
ba6698795c [Cache] skip storing failure-to-save as misses in ArrayAdapter
This PR was merged into the 5.3-dev branch.
Discussion
----------
[Mime] Remove @internal from Headers methods
| 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 | 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.
- Changelog entry should follow https://symfony.com/doc/current/contributing/code/conventions.html#writing-a-changelog-entry
-->
I don't understand why the methods
- `Headers::getHeaderBody()`
- `Headers::setHeaderBody()`
- `Headers::getHeaderParameter()`
- `Headers::setHeaderParameter()`
are marked as internal.
They are already used by others libraries, like
a6c3fa9aea/Transport/MandrillApiTransport.php (L92)a6c3fa9aea/Transport/MandrillApiTransport.php (L99)
The implementation shouldn't change so they could be under the BC promise.
Plus they are useful, and I don't see any other way that reimplementing the method if we want to do something like
```
->getHeaderParameter('Content-Disposition', 'name')
```
Commits
-------
592fb13456 Remove internal annotation
This PR was merged into the 5.3-dev branch.
Discussion
----------
[Notifier] [FakeSms] Change DSN to be more realistic
| Q | A
| ------------- | ---
| Branch? | 5.x
| Bug fix? | no
| New feature? | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets | Follows https://github.com/symfony/symfony/pull/39949
| License | MIT
| Doc PR | symfony/symfony-docs#... <!-- required for new features -->
Just a minor tests change
Commits
-------
0b13575df5 [Notifier] [FakeSms] Change DSN to be more realistic
This PR was squashed before being merged into the 5.3-dev branch.
Discussion
----------
[FrameworkBundle][HttpKernel][TwigBridge] Add an helper to generate fragments URL
| Q | A
| ------------- | ---
| Branch? | 5.x
| Bug fix? | no
| New feature? | yes <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets | Fix n/a
| License | MIT
| Doc PR | todo
This PR adds a new helper to generate raw fragment URL. Fragments will be useful to generate lazy frames with Symfony UX Turbo (https://github.com/symfony/ux/pull/64). This will also be convenient when using hinclude, ESI etc in case you want full control over the generated HTML.
This is also more in sync with the new best practices we apply in the form component (generate the HTML by yourself instead of using Twig helpers hiding the HTML elements).
Example:
```html
<turbo-frame id="set_aside_tray" src="{{ fragment_uri(controller('Symfony\Bundle\FrameworkBundle\Controller', {template: "foo.html.twig"})) }}">
<img src="/icons/spinner.gif">
</turbo-frame>
```
Commits
-------
5d29d76612 [FrameworkBundle][HttpKernel][TwigBridge] Add an helper to generate fragments URL
This PR was squashed before being merged into the 5.3-dev branch.
Discussion
----------
Messenger multiple failed transports
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets | Fix#34911
| License | MIT
| Doc PR | symfony/symfony-docs#13489
<!--
https://github.com/symfony/symfony-docs/pull/13489 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 master.
-->
## Strategy applied
- Pass a map of transports and failed transports to the `SendFailedMessageToFailureTransportListener`. This way we re-use the same listener.
- Local failed transport has more priority than a global failed transport defined.
## Configuration example
```yaml
# config/packages/messenger.yaml
framework:
# no need to set failed transport globally if I want a specific behaviour per transport.
failure_transport: failed # all transports have this failed transport
messenger:
transports:
failed: 'doctrine://default?queue_name=failed'
failed_important: 'doctrine://default?queue_name=failed_important'
async:
dsn: '%env(MESSENGER_TRANSPORT_DSN)%'
failure_transport: failed # takes precedence over the global defined "failed_transport"
retry_strategy:
max_retries: 3
delay: 1000
multiplier: 2
async_no_failure_transport: # it will use the global defined transport if no one is defined.
dsn: '%env(MESSENGER_TRANSPORT_DSN)%'
retry_strategy:
max_retries: 3
delay: 1000
multiplier: 2
async_send_specific_failure_queue:
dsn: '%env(MESSENGER_TRANSPORT_DSN)%'
failed_transport: failed_important # takes precedence over the global defined "failed_transport"
retry_strategy:
max_retries: 3
delay: 1000
multiplier: 2
```
You can test this feature easily on a [demo project](https://github.com/monteiro/messenger-multiple-failed-transports-pr34979). Just follow the [README](https://github.com/monteiro/messenger-multiple-failed-transports-pr34979).
**More information on issue #34911**
## What needs to be done so this can be merged:
- [x] validate strategy
- [ ] update src/**/CHANGELOG.md files
- [x] update tests to cover all cases
- [x] create doc PR
Commits
-------
5810b6c378 Messenger multiple failed transports
This PR was merged into the 4.4 branch.
Discussion
----------
[Serializer] Allow AbstractNormalizer to use null for non-optional nullable constructor parameters without default value
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#40511
| License | MIT
Serializer component AbstractNormalizer attemps to guess constructor parameters, and falls back using default values when possible. Yet, it misses one use case: nullable non-optional parameter with value not being present in incoming input, case in which null is a valid value, not the default one, yet still valid.
This PR introduce a two-line fix that forcefully set null as value for missing from input non-optional nullable constructor parameters values.
Commits
-------
d29e433ae8 [Serializer] AbstractNormalizer force null for non-optional nullable constructor parameter denormalization when not present in input
This PR was merged into the 4.4 branch.
Discussion
----------
add missing queue_name to find(id) in doctrine messenger transport
| 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 -->
| License | MIT
This bug was noticed by @weaverryan when reviewing the PR: https://github.com/symfony/symfony/pull/38468 related to multiple failure transports.
Commits
-------
bb26a92826 add missing queue_name to find(id) in doctrine messenger transport
This PR was submitted for the 5.x branch but it was squashed and merged into the 5.2 branch instead.
Discussion
----------
[Stopwatch] Document new "name" property of StopwatchEvent
| Q | A
| ------------- | ---
| Branch? | 5.x <!-- 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 | #37676 <!-- 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.
- Changelog entry should follow https://symfony.com/doc/current/contributing/code/conventions.html#writing-a-changelog-entry
-->
In Pull Request #37676 a new property was added to the `StopwatchEvent` which was not documented in `CHANGELOG.md` file
Commits
-------
de43e36a2c [Stopwatch] Document new "name" property of StopwatchEvent