This PR was merged into the 5.2-dev branch.
Discussion
----------
[Form] Added missing German translations
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Part of #38710
| License | MIT
| Doc PR | N/A
Commits
-------
37a2ff4563 [Form] Added missing German translations.
This PR was squashed before being merged into the 5.2-dev branch.
Discussion
----------
[RateLimiter] Moved classes implementing LimiterInterface to a new namespace
| Q | A
| ------------- | ---
| Branch? | 5.x
| Bug fix? | no
| New feature? | no
| Deprecations? | no?
| Tickets |
| License | MIT
| Doc PR |
Before we release the RateLimit component.
I think it would be a good idea to put the 7 classes that belongs to a specific strategy in their own "Policy" namespace. It is very likely that it will be more strategies in the future and the `Symfony\Component\RateLimiter` namespace is crowed as it is.
I decided not to put the `CompoundLimiter` in this namespace as it is not a strategy.
Commits
-------
1e6cea56e4 [RateLimiter] Moved classes implementing LimiterInterface to a new namespace
* 5.1:
fix merge
fix merge
Remove branch-version (keep them for contracts only)
[HttpClient] relax auth bearer format requirements
[PHPUnitBridge] Silence errors from mkdir()
[DependencyInjection] Preload classes with union types correctly.
[Serializer] fix decoding float XML attributes starting with 0
add missing dutch translations
[TwigBridge] Remove "transchoice" from the code base
Support PHPUnit 8 and PHPUnit 9 in constraint compatibility trait
Add expectDeprecation, expectNotice, expectWarning, and expectError to TestCase polyfill
[String] fix before/after[Last]() returning the empty string instead of the original one on non-match
Add missing exporter function for PHPUnit 7
[Validator] Add missing romanian translations
[String] fix slicing in UnicodeString
[Cache] Use correct expiry in ChainAdapter
do not translate null placeholders or titles
* 4.4:
fix merge
Remove branch-version (keep them for contracts only)
[HttpClient] relax auth bearer format requirements
[PHPUnitBridge] Silence errors from mkdir()
[DependencyInjection] Preload classes with union types correctly.
[Serializer] fix decoding float XML attributes starting with 0
add missing dutch translations
Support PHPUnit 8 and PHPUnit 9 in constraint compatibility trait
Add expectDeprecation, expectNotice, expectWarning, and expectError to TestCase polyfill
Add missing exporter function for PHPUnit 7
[Validator] Add missing romanian translations
[Cache] Use correct expiry in ChainAdapter
do not translate null placeholders or titles
* 3.4:
Remove branch-version (keep them for contracts only)
[Serializer] fix decoding float XML attributes starting with 0
add missing dutch translations
[Validator] Add missing romanian translations
do not translate null placeholders or titles
This PR was merged into the 5.x branch.
Discussion
----------
[HttpClient] Adding missing dependency for dev
| Q | A
| ------------- | ---
| Branch? | 5.x
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets |
| License | MIT
| Doc PR |
This will make sure Travis is happy again.
Commits
-------
552e704d6c [HttpClient] Adding missing dependency for dev
This PR was squashed before being merged into the 5.x branch.
Discussion
----------
[RateLimiter] Rename RateLimiter to RateLimiterFactory
| Q | A
| ------------- | ---
| Branch? | 5.x
| Bug fix? | no
| New feature? | no
| Deprecations? | No, not released yet
| Tickets |
| License | MIT
| Doc PR | should be added
Sorry for making a few BC breaks.
@wouterj [said](https://github.com/symfony/symfony/pull/38562#issue-503193238) that this class was suggested to be named `LimiterFactory` before. But that was rejected.
Just my looking at the names of the classes we currently have:
- Rate
- RateLimit
- RateLimiter
I find it hard to know what these are doing and the difference between them. Note that none of them are used as a rate limiter (ie implements `LimiterInterface`)
I would like to be clear that a `RateLimiterFactory` is used to create an object implementing `LimiterInterface`.
Commits
-------
8be261b300 [RateLimiter] Rename RateLimiter to RateLimiterFactory
This PR was squashed before being merged into the 3.4 branch.
Discussion
----------
[Serializer] fix decoding float XML attributes starting with 0
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#38666
| License | MIT
| Doc PR | n/a
This is a naive approach to fix#38666, assuming it is something worth fixing.
I checked different cases and it seems to be fixing all of them, but I bet there will be some other edge cases which still won't be covered properly.
Commits
-------
97b4306c30 [Serializer] fix decoding float XML attributes starting with 0
This PR was merged into the 5.x branch.
Discussion
----------
[RateLimiter] Fix delete method of the cache storage
| Q | A
| ------------- | ---
| Branch? | 5.2
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | None
| License | MIT
This PR fixes a small issue with RateLimiter's cache storage and the delete method: all getItems are called with a sha1 of the id, but not the one for delete, which makes it miss the deletion.
Commits
-------
b61d9d1ea3 minor
88c1e2439e Added a test
fb540bba73 Fix delete method on RateLimiter's cache storage
This PR was merged into the 5.1 branch.
Discussion
----------
[String] fix before/after[Last]() returning the empty string instead of the original one on non-match
| Q | A
| ------------- | ---
| Branch? | 5.1
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
The current behavior is the least useful one. Returning the original string when no match is found is the most sensible behavior. It saves code instead of requiring more.
Typical example is when removing a potential suffix:
`$bar = $foo->beforeLast(['.svg', '.png']);` should remove any of these extensions if found, and return the original string otherwise.
Commits
-------
22a2740888 [String] fix before/after[Last]() returning the empty string instead of the original one on non-match
This PR was merged into the 5.x branch.
Discussion
----------
[RateLimiter] Be more type safe when fetching from cache
| Q | A
| ------------- | ---
| Branch? | 5.x
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets |
| License | MIT
| Doc PR |
This is a super minor thing. A `$cacheItem` can be a hit, but it does not contain a `LimiterStateInterface`.
Also, PSR-6 specifies that if the `$cacheItem` is not a hit, it must return null.
Commits
-------
4795756cc7 [RateLimiter] Be more type safe when fetching form cache
This PR was squashed before being merged into the 5.x branch.
Discussion
----------
[RateLimiter] Allow configuration value "no_limit"
| Q | A
| ------------- | ---
| Branch? | 5.x
| Bug fix? | maybe?
| New feature? | not sure
| Deprecations? |
| Tickets |
| License | MIT
| Doc PR |
I dont see any reason why we should allow people to configure "no_limit". I assume this was just forgotten.
Commits
-------
2b9058d6b6 [RateLimiter] Allow configuration value "no_limit"
This PR was merged into the 5.x branch.
Discussion
----------
[RateLimiter] Remove Window::sleep()
| Q | A
| ------------- | ---
| Branch? | 5.x
| Bug fix? | no
| New feature? | no
| Deprecations? |
| Tickets |
| License | MIT
| Doc PR |
This function is not needed since #38562
Commits
-------
ccbf7d5a06 [RateLimiter] Remove Window::sleep()
This PR was squashed before being merged into the 5.x branch.
Discussion
----------
[HttpClient] Fix decorating progress info in AsyncResponse
| Q | A
| ------------- | ---
| Branch? | 5.x
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#38631
| License | MIT
| Doc PR | /
This PR reverts #38413, and send AsyncContext to onProgress callback.
Commits
-------
e325f51fe2 [HttpClient] Fix decorating progress info in AsyncResponse
This PR was merged into the 5.x branch.
Discussion
----------
[HttpKernel] add `kernel.runtime_environment` = `%env(default:kernel.environment:APP_RUNTIME_ENV)%` parameter
| Q | A
| ------------- | ---
| Branch? | 5.2
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
Instead of #37584
This PR adds a new `kernel.runtime_environment` parameter, which creates a convention to use the `APP_RUNTIME_ENV` env var to define the name of the runtime environment where the app is deployed.
When this env var is not set, the parameter defaults to `kernel.environment`.
This is especially useful for defining the location of the vault for secrets: an app can be deployed in "prod" mode, but still not be deployed on the real prod deployment target. When this happens, one might not use real prod secrets but instead, use a vault with creds for staging.
This parameter enables this use case.
Commits
-------
6eb9d62bdd [HttpKernel] add `kernel.runtime_environment` = `%env(default:kernel.environment:APP_RUNTIME_ENV)%` parameter
This PR was squashed before being merged into the 4.4 branch.
Discussion
----------
[Cache] Use correct expiry in ChainAdapter
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#38632
| License | MIT
| Doc PR | n/a
When we are syncing the chain, Let's use expiry if we have it. If not, fallback to defaultLifetime.
TODO:
- [x] Add tests
Commits
-------
17e0167798 [Cache] Use correct expiry in ChainAdapter
* 5.1:
[Filesystem] Check if failed unlink was caused by permission denied
fix APCu installation for the nightly build job
skip Vulcain-based tests if the binary cannot be executed
* 4.4:
[Filesystem] Check if failed unlink was caused by permission denied
fix APCu installation for the nightly build job
skip Vulcain-based tests if the binary cannot be executed
This PR was merged into the 4.4 branch.
Discussion
----------
[HttpClient] skip Vulcain-based tests if the binary cannot be executed
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets |
| License | MIT
| Doc PR |
Commits
-------
fa265c2ee4 skip Vulcain-based tests if the binary cannot be executed
* 3.4:
[Form] Sync translations
Added dutch translations for new invalid messages
Don't skip Doctrine tests on php 8.
Bump APCu to 5.1.19 on Travis.
[WebProfilerBundle] Hide debug toolbar in print view
indexBy does not refer to attributes, but to column names
Fix Reflection file name with eval()\'d code
[HttpFoundation] Fix Range Requests
* 5.1:
Don't skip Doctrine tests on php 8.
Stop using set-env in GitHub actions.
Allow setting AMQP option "login"
Bump igbinary to v3.1.6
Add myself to CODEOWNERS for Form, OptionsResolver and TwigBundle
Reference the correct interface in the RegistryInterface deprecation in upgrade notes
Add myself to CODEOWNERS for Security and Console
Add wouterj as codeowner for Security related packages
* 4.4:
Don't skip Doctrine tests on php 8.
Stop using set-env in GitHub actions.
Bump igbinary to v3.1.6
Add myself to CODEOWNERS for Form, OptionsResolver and TwigBundle
Reference the correct interface in the RegistryInterface deprecation in upgrade notes
Add myself to CODEOWNERS for Security and Console
Add wouterj as codeowner for Security related packages
This PR was merged into the 5.x branch.
Discussion
----------
[HttpClient] Parameterize list of retryable methods
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Tickets | /
| License | MIT
| Doc PR | TODO
Retrying non-idempotent methods is not always acceptable for user. This PR adds an easy way to configure this behavior.
The `RetryDeciderInterface::shouldRetry()` now take the exception in parameter, in order to let decider not retrying the request when the methods should never by retried.
With #38420, this code would belongs to the RetryStrategy implementation, and would return an `NeverRetryDecider` when method is not allowed.
Commits
-------
56809d1b91 Parameterize list of retryed Http methods
This PR was squashed before being merged into the 5.x branch.
Discussion
----------
[RateLimiter] rename Limit to RateLimit and add RateLimit::getLimit()
| Q | A
| ------------- | ---
| Branch? | 5.x
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | Fix#38489
| License | MIT
| Doc PR | todo
After discussing #38489 with @wouterj, he agreed we should add `Limit::getLimit()` but this method name was unfortunate. We decided to rename the `Limit` object to `RateLimit` which, IMO, is a better name for the object and is inline with how this concept is described in the [RateLimit Header Fields for HTTP RFC](https://tools.ietf.org/id/draft-polli-ratelimit-headers-00.html).
Commits
-------
c5361cfc58 [RateLimiter] rename Limit to RateLimit and add RateLimit::getLimit()
This PR was squashed before being merged into the 5.x branch.
Discussion
----------
[Form] Add missing invalid_message translations
| Q | A
| ------------- | ---
| Branch? | 5.x
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
Some invalid messages were missed in #30931 (probably because of the old age of that PR). This PR adds all missing translation keys and a missing invalid message for the new WeekType.
I've also added the dutch translations (might be up for improvement, but it's a start). We should probably initiate another community initiative to translate these new messages (only a couple languages include the new invalid messages yet).
Commits
-------
86c78b6302 Added dutch translations for new invalid messages
301f0aa0db Added missing invalid messages
This PR was squashed before being merged into the 5.x branch.
Discussion
----------
[RateLimiter] Added reserve() to LimiterInterface and rename Limiter to RateLimiter
| Q | A
| ------------- | ---
| Branch? | 5.x
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
While Javier wrote documentation for this new component, we found a couple of confusing elements that might need some tweaks:
* The `Limiter` class (previously called `LimiterFactory`) has imho a bit strange name, as it's not a limiter and it doesn't implement `LimiterInterface`. It can only new limiters. I believe `LimiterFactory` - like `LockFactory` - would be the most clear, but as that was rejected before, here is another proposal using `RateLimiter`.
* `reserve()` was now only part of the token bucket implementation. That made it a bit less useful. I think I've found a way to also allow reserving future hits in the fixed window implementation, so I've moved it to the `LimiterInterface`.
Commits
-------
cd34f21254 [RateLimiter] Added reserve() to LimiterInterface and rename Limiter to RateLimiter
This PR was merged into the 5.x branch.
Discussion
----------
[Lock][Semaphore] Add Factory::createFromKey and deprecate lock.store services
I| Q | A
| ------------- | ---
| Branch? | 5.x
| Bug fix? | no
| New feature? | no
| Deprecations? | yes
| Tickets | /
| License | MIT
| Doc PR | todo
The `lock` service and aliases have been deprecated in #38576. This PR also deprecate the `lock.store` service and aliases.
People should always inject the factory into their services, except for one scenario: When they want building the `Lock` manually because they want to keep the key.
This scenario require declaring `lock.store` service and `PersisingStoreInterface` aliases.
This could be avoided if people had a method to create a lock from a given key.
This PR adds a `LockFactory::createFromKey()` method and deprecate all `lock.store` services
I also updated the Semaphore component for consistency, and helping people to only inject the SemahoreFactory.
nb: use cases for serializing the keys:
- Netflix allows only 5 users of the same family at the same time.
- An holiday apartment rental avoid users putting the same apartment in the basket
- ...
Commits
-------
91fa3e311d Deprecate lock.store aliases
This PR was merged into the 5.x branch.
Discussion
----------
[HttpClient] added `extra.trace_content` option to `TraceableHttpClient` to prevent it from keeping the content in memory
| Q | A
| ------------- | ---
| Branch? | 5.2
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
`TraceableHttpClient` leaks memory by definition. But sometimes, this leak is to important, especially when keeping the response content in memory.
This PR adds a new `trace_content` option under `extra` so that consumers can tell the client to not trace the content. This will be ignored when `TraceableHttpClient` is not in use.
Commits
-------
61290d5aa4 [HttpClient] added `extra.trace_content` option to `TraceableHttpClient` to prevent it from keeping the content in memory
This PR was merged into the 5.x branch.
Discussion
----------
[Console] Don't register signal handlers if pcntl is disabled
| Q | A
| ------------- | ---
| Branch? | 5.x
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#38496
| License | MIT
| Doc PR | todo
This PR skips the default signal registration when pcntl is not installed or disabled via the `disable_functions` INI directive (which is common for prod infrastructures).
When registering a `SignalableCommand`, a clear exception is thrown.
Best reviewed [without whitespaces](https://github.com/symfony/symfony/pull/38589/files?w=1)
Commits
-------
8fe876341e [Console] Don't register signal handlers if pcntl is disabled
This PR was merged into the 5.x branch.
Discussion
----------
[Semaphore] Reset Key lifetime time before we acquire it
| Q | A
| ------------- | ---
| Branch? | 5.x
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | /
| License | MIT
| Doc PR | /
This is the same issue fixed by #38553 but for Semaphore component.
Commits
-------
e7ffd5d2e7 Reset Key lifetime time in semaphore
This PR was squashed before being merged into the 5.x branch.
Discussion
----------
[RateLimiter] Adding SlidingWindow algorithm
| Q | A
| ------------- | ---
| Branch? | 5.x
| Bug fix? | no
| New feature? | yes
| Deprecations? |
| Tickets |
| License | MIT
| Doc PR | Should be added
This is a draft PR to make sure we like the idea. I'll keep working on adding tests.
Commits
-------
c6d3b70315 [RateLimiter] Adding SlidingWindow algorithm
This PR was merged into the 3.4 branch.
Discussion
----------
[HttpFoundation] Fix Range Requests
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | #38295
| License | MIT
| Doc PR |
This PR fixes some deviations from [RFC 7233](https://tools.ietf.org/html/rfc7233) for handling range requests, mentioned in #38295.
- overlapping ranges are now satisfiable (e.g. when requested range end is larger than the file size)
- range units other than `bytes` will get ignored
- range requests for methods other than `GET` will be ignored
I did not manage yet to implement the support for multiple ranges, but also don't know, if that's needed here.
Commits
-------
681804ba1a [HttpFoundation] Fix Range Requests
* 5.1:
[Contracts] add branch-aliases for dev-main
[Cache] Make Redis initializers static
[Messenger] Fixed typos in Connection
[CI] Fixed build on AppVeyor
Fix tests typo
[Lock] Reset Key lifetime time before we acquire it
[CI] Silence errors when remove file/dir on test tearDown()
Fix tests
Remove content-type check on toArray methods
* 4.4:
[Contracts] add branch-aliases for dev-main
[Cache] Make Redis initializers static
Fix tests typo
[Lock] Reset Key lifetime time before we acquire it
[CI] Silence errors when remove file/dir on test tearDown()
This PR was squashed before being merged into the 5.x branch.
Discussion
----------
Fix minor issue when sharing windows between Limiters
| Q | A
| ------------- | ---
| Branch? | 5.x
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets |
| License | MIT
| Doc PR |
If I start using my custom Limiter, then change back to `FixedWindowLimiter`, then my cache might contain a value that `FixedWindowLimiter` does not support.
This PR makes sure that we handle such switch.
Commits
-------
e9ac9712d8 Fix minor issue when sharing windows between Limiters
This PR was merged into the 4.4 branch.
Discussion
----------
[Lock] Reset Key lifetime time before we acquire it
| Q | A
| ------------- | ---
| Branch? | 5.1 (maybe lower, I'll check)
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#38541
| License | MIT
| Doc PR | n/a
Im out on somewhat deep water now. I am pretty sure we should reset the Key lifetime every time we acquire it. Without it it will me tricky to re-use a lock. (As pointed out by #38541)
@jderusse can you confirm.
Commits
-------
55ad70225a [Lock] Reset Key lifetime time before we acquire it
This PR was merged into the 4.4 branch.
Discussion
----------
Fix tests typo
| 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 #... <!-- 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 -->
While working on PSR 16 cache tests, I found this small glitch in the mocked `isHit` method
Commits
-------
047ce05f6b Fix tests typo
This PR was merged into the 3.4 branch.
Discussion
----------
Remove "version" from composer.json files, use "branch-version" instead
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
Waiting for confirmation from @Seldaek or @naderman
Commits
-------
f9ed6940fd Remove "version" from composer.json files, use "branch-version" instead
* 5.1:
[DI] fix dumping env vars
[HttpClient] skip executing the multi handle when it's freed already
[HttpClient] fix using freed curl resource at destruct time
[HttpClient] shutdown verbose output from curl at destruction
fix warning for preloading TranslatorTrait class
[Typography] Remove unneeded description comments
* 4.4:
[DI] fix dumping env vars
[HttpClient] skip executing the multi handle when it's freed already
[HttpClient] fix using freed curl resource at destruct time
[HttpClient] shutdown verbose output from curl at destruction
fix warning for preloading TranslatorTrait class
[Typography] Remove unneeded description comments
This PR was merged into the 5.x branch.
Discussion
----------
[HttpClient] simplify retry mechanism around RetryStrategyInterface
| Q | A
| ------------- | ---
| Branch? | 5.2
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
Replaces #38466
I feel like the mechanism behind RetryableHttpClient is too bloated for no pragmatic reasons.
I propose to merge RetryDeciderInterface and RetryBackoffInterface into one single RetryStrategyInterface.
Having two separate interfaces supports no real-world use case. The only implementations we provide are trivial, and they can be reused by extending the provided GenericRetryStrategy implementation if one really doesn't want to duplicate that.
The methods are also simplified by accepting an AsyncContext as argument. This makes the signatures shorter and allows accessing the "info" of the request (allowing to decide based on the IP of the host, etc).
/cc @jderusse
Commits
-------
544c3e8678 [HttpClient] simplify retry mechanism around RetryStrategyInterface
This PR was merged into the 5.x branch.
Discussion
----------
[Serializer] Enabled mapping configuration via attributes
| Q | A
| ------------- | ---
| Branch? | 5.x
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Tickets | N/A
| License | MIT
| Doc PR | TODO
Let's use attributes for the serializer mapping configuration!
```php
class MyEntity
{
#[Groups(['list', 'detail])]
#[SerializedName('some-property')]
public $someProperty;
#[Ignore]
public string $secret;
}
```
Commits
-------
cfb9986203 [Serializer] Enabled mapping configuration via attributes.
This PR was merged into the 5.x branch.
Discussion
----------
[Form] fix ViolationMapper was always generating a localized label for each FormType
| Q | A
| ------------- | ---
| Branch? | 5.x (fix new behavior from 5.2)
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | /
| License | MIT
| Doc PR | /
Follow-up of #38435, with branch changed
**Explanation of the issue**
In Symfony 5.2, the `{{ label }}` placeholder can be used in constraint messages (-> introduced in commit 0d9f44235c)
However, the way it was coded is introducing a small side effect: now, every time there is validation error, `ViolationMapper` will ask the Form Type its `label`, and if not `false`, it will try to translate it.
**Why it is important/why it causes a BC break**
Since by default `AbstractType` does not have any `label`, it also introduces a minor BC break.
I will explain it with an example: in a project I work on, we check we don't have any missing translation. Sometimes we have violation errors bound to form ; then current code will get Form `label`, which in `null` in form type classes (which is quite usual I believe), so it will generate one, and pass that one to translator. And we see a lot on erroneous missing translations.
**Proposed fix**
This fix moves all this logic into a `if`, so `ViolationMapper` call the translator component only if `{{ label }}` placeholder is used in constraint error message.
On top of fixing BC, it has the benefit of lowering the performance cost for every violation when the feature is not used.
I added a test, as I believe the behavior should be guaranteed from now on.
Commits
-------
aee5571a71 [Form] fix ViolationMapper was always generating a localized label for each FormType
This PR was merged into the 5.x branch.
Discussion
----------
[Mailer] Fix mailjet image embedding
Filename is not enough to embed the image through cid, ContentID field
has to be set with the cid identifier used in the HTMLPart
| Q | A
| ------------- | ---
| Branch? | 5.1 <!-- 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 | none <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License | MIT
| Doc PR | not needed <!-- 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.
-->
Hello!
While switching from `Mandrill` to `Mailjet` I noticed that embedding images was not working properly, the `Content-ID` mime is not set properly without setting the `ContentID` key. With this change things will work as described in the [symfony documentation](https://symfony.com/doc/current/mailer.html#embedding-images)
[Mailjet reference](https://dev.mailjet.com/email/guides/send-api-v31/#send-with-attached-files)
Commits
-------
7ab772eeea [Mailer] Fix mailjet image embedding