-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[DependencyInjection] Tagged services with negative priority #50900
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
Comments
Can you create a small example application that allows to reproduce your issue? |
I will try to do it tomorrow with simple test. |
@xabbuh Hi, you can find a project with the bug here : Phenix789/symfony-project#1 |
I also see something. public function __invoke(
#[TaggedIterator('controller.argument_value_resolver')
iterable $resolvers,
) {
dump(iterator_to_array($resolvers));
exit();
} The bug seems really be in how |
May be a duplicate of #48019. In that case it would be a documentation issue because duplicated tags caused by autoconfiguration were deemed a feature. As you figured out, disabling autoconfiguration would then be the solution. |
The trouble with this, it's it works in 6.2 and not anymore in 6.3. And disable autoconfiguration for a service can be a bit "painful" when it implement several autoconfigured interfaces (like |
The change was the introduction of the @nicolas-grekas do you know why #35957 only ignores extra autoconfigured tags when |
I allow myself to up this issue. |
Hey, thanks for your report! |
Hello? This issue is about to be closed if nobody replies. |
Hey, I didn't hear anything so I'm going to close it. Feel free to comment if this is still relevant, I can always reopen! |
Symfony version(s) affected
6.3
Description
By upgrading from 6.2 to 6.3, services implemente an
registerForAutoconfiguration()
interface with negative priority are not sorted correctly.This seems happen only when
$needsIndexes
is set to true (see below).How to reproduce
ValueResolverInterface
isregisterForAutoconfiguration
ControllerArgumentValueResolverPass
callfindAndSortTaggedServices()
with aTaggedIteratorArgument
and$needsIndexes
totrue
instead of a simplestring
.The behavior of this method is changed and instead of register service only once by
continue 2
, the service is registered twice one with -70 priority and one with 0 priority.uasort()
sort the service with priority 0 before the -70 one (normal)$refs
construction add the priority 0 first and the -70 only rewrite it.Possible Solution
Locally, I need to register my service with
autoconfigure(false)
.Additional Context
No response
The text was updated successfully, but these errors were encountered: