This PR was submitted for the master branch but it was merged into the 4.4 branch instead.
Discussion
----------
[Cache] Connect to RedisCluster with password auth
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
Currently it is not possible to connect to RedisCluster with password. AUTH param is described in documentation (last example) https://symfony.com/doc/current/components/cache/adapters/redis_adapter.html#configure-the-connection but totally ignored in the code and connection fails
```
RedisAdapter::createConnection(
'redis:?host[localhost]&host[localhost:6379]&host[/var/run/redis.sock:]&auth=my-password&redis_cluster=1'
);
```
See RedisCluster usage here https://github.com/phpredis/phpredis/blob/develop/cluster.markdown#declaring-a-cluster-with-an-array-of-seeds
Commits
-------
e873ddd72c Connect to RedisCluster with password auth
This PR was merged into the 3.4 branch.
Discussion
----------
[3.4] Fix PHPUnit 8.5 deprecations
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | #37564
| License | MIT
| Doc PR | N/A
PHPUnit 8.5 introduced several deprecations. Addressing them will allow us to upgrade to PHPUnit 9.
Commits
-------
ec525e6e04 Fix PHPUnit 8.5 deprecations.
This PR was merged into the 5.1 branch.
Discussion
----------
[PhpUnitBridge] Fix tests on Windows
| Q | A
| ------------- | ---
| Branch? | 5.1
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
Commits
-------
266fe76208 [PhpUnitBridge] Fix tests on Windows
* 5.1:
fix merge
Require PHPUnit 9.3 on PHP 8
[Cache] fix catching auth errors
Fix CS
[FrameworkBundle] set default session.handler alias if handler_id is not provided
Fix CS
Readability update
Removed @internal from Composite
Fix checks for phpunit releases on Composer 2 (resolves#37601)
[Messenger] fix ignore account & endpoint options amazon sqs connection
[Serializer] Support multiple levels of discriminator mapping
Use hexadecimal numerals instead of hexadecimals in strings to represent error codes.
[SCA] Minor fixes on tests
[WebProfilerBundle] modified url generation to use absolute urls
[Mailer] Fix reply-to functionality in the SendgridApiTransport
[Mime] Fix compat with HTTP requests
ticket_36879 - Fix mandrill raw http request setting from email/name
* 5.0:
fix merge
Require PHPUnit 9.3 on PHP 8
[Cache] fix catching auth errors
Fix CS
[FrameworkBundle] set default session.handler alias if handler_id is not provided
Fix CS
Readability update
Fix checks for phpunit releases on Composer 2 (resolves#37601)
[Serializer] Support multiple levels of discriminator mapping
Use hexadecimal numerals instead of hexadecimals in strings to represent error codes.
[SCA] Minor fixes on tests
[WebProfilerBundle] modified url generation to use absolute urls
[Mailer] Fix reply-to functionality in the SendgridApiTransport
[Mime] Fix compat with HTTP requests
ticket_36879 - Fix mandrill raw http request setting from email/name
* 4.4:
fix merge
Require PHPUnit 9.3 on PHP 8
[Cache] fix catching auth errors
Fix CS
[FrameworkBundle] set default session.handler alias if handler_id is not provided
Fix CS
Readability update
Fix checks for phpunit releases on Composer 2 (resolves#37601)
[Serializer] Support multiple levels of discriminator mapping
Use hexadecimal numerals instead of hexadecimals in strings to represent error codes.
[SCA] Minor fixes on tests
[WebProfilerBundle] modified url generation to use absolute urls
[Mailer] Fix reply-to functionality in the SendgridApiTransport
[Mime] Fix compat with HTTP requests
ticket_36879 - Fix mandrill raw http request setting from email/name
* 3.4:
[Cache] fix catching auth errors
Fix CS
[FrameworkBundle] set default session.handler alias if handler_id is not provided
Fix CS
Readability update
Fix checks for phpunit releases on Composer 2 (resolves#37601)
[SCA] Minor fixes on tests
This PR was squashed before being merged into the 4.4 branch.
Discussion
----------
Require PHPUnit 9.3 on PHP 8
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| License | MIT
The first version of PHPUnit to support PHP 8.0 is PHPUnit 9.3.
---
Depends on https://github.com/symfony/symfony/pull/37607. Related to https://github.com/composer/composer/pull/9054.
Commits
-------
54b13c04c9 Require PHPUnit 9.3 on PHP 8
This PR was merged into the 4.4 branch.
Discussion
----------
[Serializer] Support multiple levels of discriminator mapping
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| License | MIT
When using multiple levels of discriminator mapping for denormalizing to a multiple level class hierarchy, only the top level discriminator mapping is considered, resulting in an error: **Cannot instantiate abstract class ...**
Example:
```php
/**
* @DiscriminatorMap(typeProperty="type", mapping={"group"=GroupNode::class, "item"=ItemNode::class})
*/
abstract class Node {
// ...
}
class GroupNode extends Node {
// ...
}
/**
* @DiscriminatorMap(typeProperty="item_type", mapping={"foo"=FooItemNode::class, "bar"=BarItemNode::class})
*/
abstract class ItemNode extends Node {
// ...
}
class FooItemNode {
// ...
}
class BarItemNode {
// ...
}
$objectNormalizer = new ObjectNormalizer(new ClassMetadataFactory(new AnnotationLoader(new AnnotationReader())));
$node = $objectNormalizer->denormalize(['type' => 'item', 'item_type' => 'foo']);
```
This results in an error: **Cannot instantiate abstract class ItemNode**. Expected is that `$node` is of type `FooItemNode` after denormalization.
The solution is to recursively call `AbstractObjectNormalizer::instantiateObject()` when a mapping is found, instead of always calling `parent::instantiateObject()`.
Commits
-------
324ad95fee [Serializer] Support multiple levels of discriminator mapping
This PR was merged into the 5.1 branch.
Discussion
----------
[Messenger] fix ignored account & endpoint options amazon sqs connection
| 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 | Fix#37598 <!-- 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 master.
-->
Commits
-------
fc90a3b7c6 [Messenger] fix ignore account & endpoint options amazon sqs connection
This PR was squashed before being merged into the 3.4 branch.
Discussion
----------
[FrameworkBundle] set default session.handler alias if handler_id is not provided
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#37245
| License | MIT
| Doc PR |
Without a configured [`handler_id`](https://symfony.com/doc/current/session.html#configuration), the `session.handler` alias is not created, and somes services depend on this alias specialy.
Related to the reported issue above (affected version 4.4.9), the `ServiceHandlerInterface` is an alias of `session.handler`, when execute :
- `bin/console debug:container session.handler` : The alias is not defined, so the `ContainerDebugCommand` look for a service containing the `session.handler` as part of his name (ContainerDebugCommand::findServiceIdsContaining() is called and returns by default `session.handler.native_file`)
- `bin/console debug:container SessionHandlerInterface` : The service is defined as an alias of `session.handler`, when calling `ContainerBuilder::getDefinition('session.handler')` the exception occured as the alias is not defined.
# Implemented solution
Create a default `session.handler` when the param `handler_id` is not provided (I choosed `session.handler.native_file` rather than `NullSessionHandler`).
# Affected versions
From [`3.4`](https://github.com/symfony/framework-bundle/blob/3.4/DependencyInjection/FrameworkExtension.php#L879) to [`5.1`](https://github.com/symfony/framework-bundle/blob/5.1/DependencyInjection/FrameworkExtension.php#L955)
Commits
-------
46c8c3791b [FrameworkBundle] set default session.handler alias if handler_id is not provided
This PR was submitted for the master branch but it was merged into the 3.4 branch instead.
Discussion
----------
[WebProfileBundle] Readability update
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| License | MIT
Updating ContentSecurityPolicyHandler by moving array out of foreach loop for ease of readability.
Commits
-------
6a7685f315 Readability update
This PR was submitted for the master branch but it was merged into the 5.1 branch instead.
Discussion
----------
Removed @internal from Composite
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Tickets | Fix#37348
| License | MIT
I think that Composite should not be @internal. Even with the new @Compound constraint Composite is still useful for complex custom validators.
For example, I have @ExcelColumn(string $column, array $constraints) that checks that all cells in a column of an uploaded Excel file are valid. This cannot be expressed with @Compound.
Commits
-------
8958ce12a1 Removed @internal from Composite
This PR was merged into the 3.4 branch.
Discussion
----------
Fix checks for phpunit releases on Composer 2
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#37601
| License | MIT
| Doc PR | n/a
`simple-phpunit` has a core assumption that any version of PHPUnit without a stable release will only have one dev version returned by Composer. Per https://github.com/symfony/symfony/issues/37601, it's possible for Composer 2 to list **more than one dev version**. This breaks that assumption and therefore prevents the installation of 9.3.* ([which is needed for testing on PHP 8](https://github.com/sebastianbergmann/phpunit/pull/4374#issuecomment-657029594)).
The fix implemented here is to remove any versions containing `dev-` or `-dev` from the list of possible versions to see if any stable versions remain.
Commits
-------
2bb3f08fba Fix checks for phpunit releases on Composer 2 (resolves#37601)
This PR was merged into the 3.4 branch.
Discussion
----------
[SCA] Minor fixes on tests
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
I mainly fixed misordered arguments in `assertEquals()`.
Commits
-------
b352ff08ad [SCA] Minor fixes on tests
This PR was merged into the 5.1 branch.
Discussion
----------
[Mailer] Fix failover transport
| 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 | Fix#37593 <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License | MIT
| Doc PR | n/a
This fixes a regression in 5.1.
Commits
-------
8b673f5a81 [Mailer] Fix failover transport
This PR was submitted for the master branch but it was merged into the 4.4 branch instead.
Discussion
----------
Use hexadecimal numerals instead of hexadecimals in strings to repres…
Use hexadecimal numerals instead of hexadecimals in strings to represent error codes.
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#37577 , #36327
| License | MIT
Class constants are now hexadecimal numerals instead of hexadecimals in strings.
Commits
-------
e9f7769111 Use hexadecimal numerals instead of hexadecimals in strings to represent error codes.
This PR was merged into the 4.4 branch.
Discussion
----------
[WebProfilerBundle] modified url generation to use absolute urls
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets |
| License | MIT
| Doc PR |
## TODO
- [x] gather feedback for my changes
## Use case
The web debug toolbar ajax calls are broken in the case when you have to work with a page template that uses HTML `<base>` Tag for whatever reason.
In this case, the ajax calls of the debug toolbar will target that base url, as these urls are rendered as relative urls in the injected toolbar HTML content.
A simple solution for this issue is to generate absolute urls for these calls - this is my first approach in this PR.
A more complex solution would be a configurable behavior with the current method as the default.
I believe though that the simple solution is enough here, as it will result in the same requests for developers using templates without any `<base>` tag, and it will also make the dev toolbar usable for my case (using a `<base>` tag).
(Please let me know if I should make this PR against another branch.)
Commits
-------
3f3976bd94 [WebProfilerBundle] modified url generation to use absolute urls
This PR was merged into the 5.2-dev branch.
Discussion
----------
[HttpKernel] hide "_password" in request data collector raw content
The password was already hidden in POST parameters, but still remained visible in raw content.
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| License | MIT
This is my first contribution, so I hope I did everything right :)
Commits
-------
715c793070 [HttpKernel] added password hiding in request data collector raw content
The password was already hidden in POST parameters, but still remained visible in raw content
[HttpKernel] added password hiding in request data collector raw content
The password was already hidden in POST parameters, but still remained visible in raw content
[HttpKernel] added password hiding in request data collector raw content
The password was already hidden in POST parameters, but still remained visible in raw content
This PR was squashed before being merged into the 5.2-dev branch.
Discussion
----------
[PhpUnitBridge] Polyfill new phpunit 9.1 assertions
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Tickets | Fix#37320
| License | MIT
| Doc PR | n/a
This PR adds the following new assertions that was added to PhpUnit 9.1:
- Implement **`assertIsNotReadable()`** as alternative for `assertNotIsReadable()`
- Implement **`assertIsNotWritable()`** as alternative for `assertNotIsWritable()`
- Implement **`assertDirectoryDoesNotExist()`** as alternative for `assertDirectoryNotExists()`
- Implement **`assertDirectoryIsNotReadable()`** as alternative for `assertDirectoryNotIsReadable()`
- Implement **`assertDirectoryIsNotWritable()`** as alternative for `assertDirectoryNotIsWritable()`
- Implement **`assertFileDoesNotExist()`** as alternative for `assertFileNotExists()`
- Implement **`assertFileIsNotReadable()`** as alternative for `assertFileNotIsReadable()`
- Implement **`assertFileIsNotWritable()`** as alternative for `assertFileNotIsWritable()`
- Implement **`assertMatchesRegularExpression()`** as alternative for `assertRegExp()`
- Implement **`assertDoesNotMatchRegularExpression()`** as alternative for `assertNotRegExp()`
Commits
-------
51c0bf0d0d [PhpUnitBridge] Polyfill new phpunit 9.1 assertions
This PR was merged into the 4.4 branch.
Discussion
----------
[Mailer] Fix mandrill raw http request setting from email/name
| Q | A
| ------------- | ---
| Branch? | 4.4, 5.0, 5.1
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#36879
| License | MIT
| Doc PR | None
As describe in https://github.com/symfony/symfony/issues/36879 there is a bug in sending raw http request to mandrill it will not set from email/name correct.
As you can see i make sure to set `from_email` and `from_name` correct now and changed the unit test to check correct you can see the doc that the format is correct https://mandrillapp.com/api/docs/messages.curl.html#method-send-raw
Commits
-------
6128dd0b75 ticket_36879 - Fix mandrill raw http request setting from email/name
This PR was merged into the 5.2-dev branch.
Discussion
----------
[HttpFoundation] Added File::getContent()
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Tickets |
| License | MIT
| Doc PR |
---
This is a very simple PR but I think it increases the DX when working
with uploaded files: I looked at for this method and I did not found it.
So I had to check witch method returns the "pathname" or to remember I
can cast the object to string to get its pathname.
It's a small detail, but IMHO it's better with it.
About file_get_contents vs stream: let's be simple here. If one want a
stream, they can use the code they always used for it :)
Commits
-------
50d5167a66 [HttpFoundation] Added File::getContent()
This PR was squashed before being merged into the 4.4 branch.
Discussion
----------
[Mailer] Fix reply-to functionality in the SendgridApiTransport
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets |
| License | MIT
| Doc PR |
When sending a message using the `SendgridApiTransport`, the reply-to address was being ignored. In other transports, the reply to can be set using headers, but SendGrid requires that certain fields be added explicitly to the API payload. This is already handled for From, To, Cc, Bcc, and Subject, but was not handled for Reply-To. This change extracts the reply to address from the `Email` object and adds it to the payload.
Note that the `Email` object allows for multiple Reply-To addresses, but SendGrid only supports a single one, so I am just using the first element of the array.
I also fixed a link in a comment to SendGrid's documentation explaining the reserved headers that are not allowed.
Commits
-------
2cf25d1055 [Mailer] Fix reply-to functionality in the SendgridApiTransport