Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate constructing AdminPoolLoader with more than one argument #6978

Merged

Conversation

franmomu
Copy link
Member

@franmomu franmomu commented Mar 28, 2021

Subject

The container was added in eefe79c to solve #128, I've marked this PR as draft, as I'm not sure if it is not needed anymore, I'll try to search about this or if someone has some knowledge about this, would be appreciated.

Ref: #6963

I am targeting this branch, because these changes are BC.

Changelog

### Deprecated
- Deprecated constructing `AdminPoolLoader` passing more than one argument. 
- Deprecated `AdminPoolLoader` service alias.

@franmomu franmomu added the minor label Mar 28, 2021
phansys
phansys previously approved these changes Mar 28, 2021
@franmomu franmomu force-pushed the remove_container_from_admin_pool branch from a4106e0 to 774e64f Compare March 29, 2021 13:29
@franmomu franmomu marked this pull request as ready for review March 29, 2021 13:29
@franmomu franmomu force-pushed the remove_container_from_admin_pool branch 2 times, most recently from 4e8bae3 to 8eea762 Compare March 29, 2021 13:38
@franmomu
Copy link
Member Author

Digging a bit more about this, in symfony/symfony#36143 the container was added in the router cache, so there is no need for as to add the resource.

I've also deprecated passing the serviceAdminIds argument since we can get them from Pool.

@@ -238,9 +238,6 @@ static function (array $a, array $b): int {
$pool->replaceArgument(1, $admins);
$pool->replaceArgument(2, $groups);
$pool->replaceArgument(3, $classes);

$routeLoader = $container->getDefinition('sonata.admin.route_loader');
$routeLoader->replaceArgument(1, $admins);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These $admins are the same that the ones injected to the Pool (5 lines above).

phansys
phansys previously approved these changes Mar 29, 2021
])

->alias(AdminPoolLoader::class, 'sonata.admin.route_loader')
->deprecate(...BCDeprecationParameters::forConfig(
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've also deprecated the alias since I don't think it's useful, the original service is meant to be loaded as routing.loader, not to inject it in another service.

@franmomu
Copy link
Member Author

Sorry @phansys 😞 I forgot to add the alias deprecation in the changelog (I think now it's fine).

phansys
phansys previously approved these changes Mar 29, 2021
@phansys phansys requested a review from a team March 29, 2021 13:46
VincentLanglet
VincentLanglet previously approved these changes Mar 29, 2021
@VincentLanglet VincentLanglet requested a review from a team March 29, 2021 13:52
@franmomu franmomu changed the title Deprecate constructing AdminPoolLoader with a third argument Deprecate constructing AdminPoolLoader with more than one argument Mar 29, 2021
@VincentLanglet
Copy link
Member

@franmomu a rebase is needed :)

The container was added to the router cache in
symfony/framework-bundle in 4.4.6.

See symfony/symfony#36143
@franmomu franmomu dismissed stale reviews from VincentLanglet and phansys via 4c42e99 March 29, 2021 16:03
@franmomu franmomu force-pushed the remove_container_from_admin_pool branch from 99de67f to 4c42e99 Compare March 29, 2021 16:03
@VincentLanglet VincentLanglet merged commit 489f9de into sonata-project:3.x Mar 29, 2021
@franmomu
Copy link
Member Author

I'll do the merge

@franmomu franmomu deleted the remove_container_from_admin_pool branch March 29, 2021 16:06
@VincentLanglet
Copy link
Member

I'll do the merge

Wait, I was creating the release first

@franmomu
Copy link
Member Author

ok, I'll create the PRs to update persistence bundles.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants