Commit Graph

53116 Commits

Author SHA1 Message Date
Robin Chalas
23d257460d Merge branch '5.2' into 5.x
* 5.2:
  [Security] Replace message data in JSON security error response
  [Security] Replace message data in JSON security error response
  [DI] Skip deprecated definitions in CheckTypeDeclarationsPass
  [Messenger][AmazonSqs] Fix auto-setup for fifo queue
  [DoctrineBridge] Take into account that indexBy="person_id" could be a db column name, for a referenced entity
2021-01-17 11:59:47 +01:00
Robin Chalas
c702c47f54 Merge branch '5.1' into 5.2
* 5.1:
  [Security] Replace message data in JSON security error response
  [DI] Skip deprecated definitions in CheckTypeDeclarationsPass
  [Messenger][AmazonSqs] Fix auto-setup for fifo queue
  [DoctrineBridge] Take into account that indexBy="person_id" could be a db column name, for a referenced entity
2021-01-17 11:58:44 +01:00
Robin Chalas
f2c5f25a98 Merge branch '4.4' into 5.1
* 4.4:
  [Security] Replace message data in JSON security error response
  [DI] Skip deprecated definitions in CheckTypeDeclarationsPass
  [DoctrineBridge] Take into account that indexBy="person_id" could be a db column name, for a referenced entity
2021-01-17 11:37:09 +01:00
Fabien Potencier
fa87194fe7 feature #39843 [FrameworkBundle] Add renderForm() helper setting the appropriate HTTP status code (dunglas)
This PR was squashed before being merged into the 5.3-dev branch.

Discussion
----------

[FrameworkBundle] Add renderForm() helper setting the appropriate HTTP status code

| 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       | n/a
| License       | MIT
| Doc PR        | todo

A 422 HTTP status code should be returned after the submission of an invalid form. Some libraries including [Turbo](https://github.com/hotwired/turbo/pull/39) rely on this behavior and will not display the updated form (containing errors) unless this status code is present.

Rails also [recently switched to this behavior ](https://github.com/rails/rails/pull/41026) by default for the same reason.

I propose to introduce a new helper method rendering the form and setting the appropriate status code. It makes the code cleaner:

```php
// src/Controller/TaskController.php

// ...
use Symfony\Component\HttpFoundation\Request;

class TaskController extends AbstractController
{
    public function new(Request $request): Response
    {
        $task = new Task();
        $form = $this->createForm(TaskType::class, $task);

        $form->handleRequest($request);
        if ($form->isSubmitted() && $form->isValid()) {
            $task = $form->getData();
            // ...

            return $this->redirectToRoute('task_success');
        }

        return $this->renderForm('task/new.html.twig', $form);
    }
}
```

Commits
-------

4c77e50e6a [FrameworkBundle] Add renderForm() helper setting the appropriate HTTP status code
2021-01-17 08:35:40 +01:00
Kévin Dunglas
4c77e50e6a [FrameworkBundle] Add renderForm() helper setting the appropriate HTTP status code 2021-01-17 08:35:35 +01:00
Fabien Potencier
93e853dd09 feature #39852 [Security] RoleHierarchy returns an unique array of roles (lyrixx)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[Security] RoleHierarchy returns an unique array of roles

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | no
| New feature?  | yes: performance
| Deprecations? |
| Tickets       |
| License       | MIT
| Doc PR        |

Speedup: https://github.com/symfony/symfony/blob/5.x/src/Symfony/Component/Security/Core/Authorization/Voter/RoleVoter.php#L48
BTW, why isn't an `in_array()` there?

Commits
-------

aa0494c6fc [Security] RoleHierarchy returns unique an unique array of roles
2021-01-17 08:29:02 +01:00
Fabien Potencier
771a2a4277 feature #39855 [HttpFoundation] deprecate the NamespacedAttributeBag class (xabbuh)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[HttpFoundation] deprecate the NamespacedAttributeBag class

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | no
| New feature?  | no
| Deprecations? | yes
| Tickets       | Fix #32616
| License       | MIT
| Doc PR        |

Commits
-------

da9de69de0 deprecate the NamespacedAttributeBag class
2021-01-17 08:26:56 +01:00
Robin Chalas
5ba237a8ec bug #39861 [DependencyInjection] Skip deprecated definitions in CheckTypeDeclarationsPass (chalasr)
This PR was merged into the 4.4 branch.

Discussion
----------

[DependencyInjection] Skip deprecated definitions in CheckTypeDeclarationsPass

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

When a definition uses a deprecated class , `CheckTypeDeclarationsPass` (with `$autoload = true`) will autoload the class, which triggers a deprecation notice. That breaks the CI in #39802 because the compiler pass is registered inside the SecurityBundle test suite.
I propose to stop checking deprecated definitions. Makes sense?

Commits
-------

531c81a06e [DI] Skip deprecated definitions in CheckTypeDeclarationsPass
2021-01-17 00:11:08 +01:00
Robin Chalas
833a9e0a47 bug #39862 [Security] Replace message data in JSON security error response (wouterj)
This PR was merged into the 4.4 branch.

Discussion
----------

[Security] Replace message data in JSON security error response

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix part of #39663
| License       | MIT
| Doc PR        | n/a

The 4.4 part of #39859

Commits
-------

ab2ca7145f [Security] Replace message data in JSON security error response
2021-01-17 00:09:57 +01:00
Robin Chalas
5ba4925c91 bug #39859 [Security] Replace message data in JSON security error response (wouterj)
This PR was merged into the 5.2 branch.

Discussion
----------

[Security] Replace message data in JSON security error response

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

Commits
-------

5e5795acd1 [Security] Replace message data in JSON security error response
2021-01-17 00:06:41 +01:00
Wouter de Jong
ab2ca7145f [Security] Replace message data in JSON security error response 2021-01-16 23:34:24 +01:00
Wouter de Jong
5e5795acd1 [Security] Replace message data in JSON security error response 2021-01-16 23:33:07 +01:00
Christian Flothmann
da9de69de0 deprecate the NamespacedAttributeBag class 2021-01-16 11:11:08 +01:00
Mathias Arlaud
19c6544f42 [Notifier] Add mercure bridge 2021-01-16 10:46:54 +01:00
Grégoire Pineau
aa0494c6fc [Security] RoleHierarchy returns unique an unique array of roles 2021-01-15 18:40:08 +01:00
Robin Chalas
531c81a06e [DI] Skip deprecated definitions in CheckTypeDeclarationsPass 2021-01-15 18:01:26 +01:00
Oskar Stark
29b88afeb7 minor #39849 [Notifier] Fix underline (OskarStark)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[Notifier] Fix underline

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

Commits
-------

38f633132e Fix underline
2021-01-15 12:12:22 +01:00
Oskar Stark
38f633132e
Fix underline 2021-01-15 12:10:58 +01:00
Oskar Stark
3796af6a6a feature #39579 [Notifier] [GoogleChat] [BC BREAK] Rename threadKey parameter to thread_key + set parameter via ctor (OskarStark)
This PR was squashed before being merged into the 5.3-dev branch.

Discussion
----------

[Notifier] [GoogleChat] [BC BREAK] Rename threadKey parameter to thread_key + set parameter via ctor

| Q             | A
| ------------- | ---
| Branch?       | 5.x, but BC BREAK for experimental bridge
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | ---
| License       | MIT
| Doc PR        | https://github.com/symfony/symfony-docs/pull/14834
| Recipe        | https://github.com/symfony/recipes/pull/871

All bridges receive their options via the `constructor` and use snake_case parameters.

### Todos
* [x] Update recipe
* [x] Update documentation

cc @GromNaN as you provided the bridge

Commits
-------

5a71928ef1 [Notifier] [GoogleChat] [BC BREAK] Rename threadKey parameter to thread_key + set parameter via ctor
2021-01-15 11:33:44 +01:00
Oskar Stark
5a71928ef1 [Notifier] [GoogleChat] [BC BREAK] Rename threadKey parameter to thread_key + set parameter via ctor 2021-01-15 11:33:37 +01:00
Nicolas Grekas
402a800971 bug #39839 [Messenger] [AmazonSqs] Fix auto-setup for fifo queue (starred-gijs)
This PR was submitted for the 5.x branch but it was merged into the 5.1 branch instead.

Discussion
----------

[Messenger] [AmazonSqs] Fix auto-setup for fifo queue

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

When you want the AmazonSqs transport to create the queue on the fly and you have a fifo queue, the parameters are wrong, and a regular queue is created. This PR fixes the parameters.

Commits
-------

308f8fede0 [Messenger][AmazonSqs] Fix auto-setup for fifo queue
2021-01-15 11:12:41 +01:00
Gijs van Lammeren
308f8fede0 [Messenger][AmazonSqs] Fix auto-setup for fifo queue 2021-01-15 11:12:31 +01:00
Oskar Stark
28533aa43c Merge branch '5.2' into 5.x
* 5.2:
  [Notifier] [GoogleChat] Fix wrong test
2021-01-15 10:44:43 +01:00
Oskar Stark
8fc46dc894 minor #39848 [Notifier] [GoogleChat] Fix wrong test (OskarStark)
This PR was merged into the 5.2 branch.

Discussion
----------

[Notifier] [GoogleChat] Fix wrong test

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

Follows https://github.com/symfony/symfony/pull/39579/files#r558022816

cc @jderusse

Commits
-------

8ab7027e4b [Notifier] [GoogleChat] Fix wrong test
2021-01-15 10:43:16 +01:00
Christian Flothmann
8076c2f8ba bug #39667 [DoctrineBridge] Take into account that indexBy="person_id" could be a db column name, for a referenced entity (victormacko)
This PR was merged into the 4.4 branch.

Discussion
----------

[DoctrineBridge] Take into account that indexBy="person_id" could be a db column name, for a referenced entity

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

In Symfony 4.4.17 (I think), using ManyToMany in doctrine, along with indexBy="person_id" (in the related entity, which has a property of "id" (which in-turn uses the db column "person_id" worked as expected. When upgrading to Symfony 5.2.1, this stops working.

This change continues on from issue #37982 to fix a further edge case.

Commits
-------

472eab11e9 [DoctrineBridge] Take into account that indexBy="person_id" could be a db column name, for a referenced entity
2021-01-15 10:06:59 +01:00
Oskar Stark
8ab7027e4b [Notifier] [GoogleChat] Fix wrong test 2021-01-15 09:35:51 +01:00
victor
472eab11e9 [DoctrineBridge] Take into account that indexBy="person_id" could be a db column name, for a referenced entity 2021-01-15 09:23:31 +01:00
Oskar Stark
f1df7093dd minor #39832 [Notifier] [Octopush] Use the correct provider (OskarStark)
This PR was merged into the 5.3-dev branch.

Discussion
----------

[Notifier] [Octopush] Use the correct provider

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

Follows #39702

Commits
-------

9ecef3bfa1 [Notifier] [Octopush] Use the correct provider
2021-01-15 07:26:42 +01:00
Nicolas Grekas
f7a09262cd Merge branch '5.2' into 5.x
* 5.2:
  [VarDumper] Fix tests
2021-01-14 21:47:39 +01:00
Nicolas Grekas
99a8ef5a37 [VarDumper] Fix tests 2021-01-14 21:47:05 +01:00
Nicolas Grekas
51da7d7cf9 Merge branch '5.2' into 5.x
* 5.2:
  [travis] always install ext-mongodb
  Fix circular loop with EntityManager
2021-01-14 21:28:05 +01:00
Nicolas Grekas
541f9927f1 Merge branch '5.1' into 5.2
* 5.1:
  [travis] always install ext-mongodb
  Fix circular loop with EntityManager
2021-01-14 21:26:19 +01:00
Nicolas Grekas
a0ac3b0f76 Merge branch '4.4' into 5.1
* 4.4:
  [travis] always install ext-mongodb
  Fix circular loop with EntityManager
2021-01-14 21:09:08 +01:00
Nicolas Grekas
dd142e2548 minor #39844 [travis] always install ext-mongodb (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[travis] always install ext-mongodb

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

Commits
-------

7cc9904e6a [travis] always install ext-mongodb
2021-01-14 21:08:44 +01:00
Nicolas Grekas
7cc9904e6a [travis] always install ext-mongodb 2021-01-14 20:57:15 +01:00
Nicolas Grekas
2c9a837ac7 bug #39799 [DoctrineBridge] Fix circular loop with EntityManager (jderusse)
This PR was merged into the 4.4 branch.

Discussion
----------

[DoctrineBridge] Fix circular loop with EntityManager

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

This PR fix a segfault in EntityManager by making the LazyEventManager handle EventSubscriber in a lazy way.

Maybe #34200 too

Commits
-------

23d692107c Fix circular loop with EntityManager
2021-01-14 20:19:38 +01:00
Jérémy Derussé
23d692107c
Fix circular loop with EntityManager 2021-01-14 19:54:59 +01:00
Robin Chalas
4add45d1c9 fix merge 2021-01-14 18:47:35 +01:00
Robin Chalas
de5d0fd3e2 Merge branch '5.2' into 5.x
* 5.2:
  [DI] fix merge
2021-01-14 18:46:37 +01:00
Robin Chalas
b8dafc6670 Merge branch '5.1' into 5.2
* 5.1:
  [DI] fix merge
2021-01-14 18:46:00 +01:00
Robin Chalas
67273da71b [DI] fix merge 2021-01-14 18:42:31 +01:00
Nicolas Grekas
fe49ed2e42 Merge branch '5.2' into 5.x
* 5.2:
  µCS fix
  CS fix
  CS fix
  [travis] use PHP 8.0 to patch return types and run deps=low
  Add me as a Notifier code owner
  Update sl_SI translations
  Don't trigger deprecation for deprecated aliases pointing to deprecated definitions
  [HttpFoundation] use atomic writes in MockFileSessionStorage
  fix typo
  Make EmailMessage & SmsMessage transport nullable
  remove unused argument
  [SecurityBundle] Drop dead check
  [DI] fix param annotation
  [SecurityBundle] Remove invalid service definition
  [Config] Add \Symfony\Component\Config\Loader::load() return type
  Simplify PHP CS Fixer config
  Rename normalize param
2021-01-14 16:43:35 +01:00
Nicolas Grekas
106c693c48 Merge branch '5.1' into 5.2
* 5.1:
  µCS fix
  CS fix
  CS fix
  [travis] use PHP 8.0 to patch return types and run deps=low
  Add me as a Notifier code owner
  Update sl_SI translations
  Don't trigger deprecation for deprecated aliases pointing to deprecated definitions
  [HttpFoundation] use atomic writes in MockFileSessionStorage
  Make EmailMessage & SmsMessage transport nullable
  remove unused argument
  [DI] fix param annotation
  [Config] Add \Symfony\Component\Config\Loader::load() return type
  Simplify PHP CS Fixer config
  Rename normalize param
2021-01-14 16:42:36 +01:00
Nicolas Grekas
07431bbbab Merge branch '4.4' into 5.1
* 4.4:
  µCS fix
2021-01-14 16:33:09 +01:00
Nicolas Grekas
1d7c3f6d6e µCS fix 2021-01-14 16:32:58 +01:00
Nicolas Grekas
134695cace CS fix 2021-01-14 16:32:37 +01:00
Nicolas Grekas
41a7eaa654 Merge branch '4.4' into 5.1
* 4.4:
  CS fix
  [travis] use PHP 8.0 to patch return types and run deps=low
  Update sl_SI translations
  Don't trigger deprecation for deprecated aliases pointing to deprecated definitions
  [HttpFoundation] use atomic writes in MockFileSessionStorage
  [DI] fix param annotation
  [Config] Add \Symfony\Component\Config\Loader::load() return type
  Simplify PHP CS Fixer config
  Rename normalize param
2021-01-14 16:25:38 +01:00
Nicolas Grekas
617c835b84 CS fix 2021-01-14 16:08:15 +01:00
Nicolas Grekas
9a04b00e69 minor #39823 [travis] use PHP 8.0 to patch return types and run deps=low (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

 [travis] use PHP 8.0 to patch return types and run deps=low

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

(I need to verify that DebugClassLoader works as expected before merging)

Commits
-------

7f5ea78fb8 [travis] use PHP 8.0 to patch return types and run deps=low
2021-01-14 16:02:41 +01:00
Nicolas Grekas
0e25f405a9 bug #39821 [DependencyInjection] Don't trigger notice for deprecated aliases pointing to deprecated definitions (chalasr)
This PR was merged into the 4.4 branch.

Discussion
----------

[DependencyInjection] Don't trigger notice for deprecated aliases pointing to deprecated definitions

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

Defining an alias that points to a deprecated definition should trigger a deprecation notice, but when the alias itself is deprecated, it should not trigger.

Commits
-------

38f98a1165 Don't trigger deprecation for deprecated aliases pointing to deprecated definitions
2021-01-14 16:01:47 +01:00