Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Fix ServiceLocator indexing when service is decorated #42347

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

Merged
merged 1 commit into from
Aug 6, 2021
Merged

Fix ServiceLocator indexing when service is decorated #42347

merged 1 commit into from
Aug 6, 2021

Conversation

shyim
Copy link
Contributor

@shyim shyim commented Aug 2, 2021

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

We save in our application the service id into the database to look up the service by a tagged locator (finding the service which handles the payment).

With Symfony 5.3 the keys are differed when the service is decorated, this breaks our application logic.

The problem has been introduced with the addition of autowired arguments. The Pass order has been changed (91fbc90#diff-b75bcd1c8a876c4e6f189c298e7c7133d1d3bc87e2a2876c40ab92a51df1093aR68)
Now the ServiceLocatorTagPass runs after the decoration magic has been done.

This PR moves the DecoratorServicePass back to the place where it was on 5.2 and previous versions

@shyim shyim changed the base branch from 5.4 to 5.3 August 2, 2021 16:14
@chalasr
Copy link
Member

chalasr commented Aug 2, 2021

The pass position might have been changed for a good reason in #40406.
ping @derrabus :)

@Nyholm Nyholm added this to the 5.3 milestone Aug 3, 2021
@derrabus
Copy link
Member

derrabus commented Aug 3, 2021

I don't recall why I did that. I guess it was necessary for my original implementation and it might very well be the case that the final implementation did not need the passes to be rearranged anymore. As long as the tests are green, I'm fine with the change.

@fabpot
Copy link
Member

fabpot commented Aug 6, 2021

Thank you @shyim.

@fabpot fabpot merged commit a206e77 into symfony:5.3 Aug 6, 2021
@fabpot fabpot mentioned this pull request Aug 30, 2021
@vudaltsov
Copy link
Contributor

After the change I've got a lot of Circular reference detected for service: now decorators are autowired into themselves. I will try to add a reproducer soon.

chalasr added a commit that referenced this pull request Dec 14, 2022
This PR was merged into the 5.4 branch.

Discussion
----------

[DependencyInjection] Fix undefined class in test

| Q             | A
| ------------- | ---
| Branch?       | 5.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | #42347 (comment)
| License       | MIT
| Doc PR        | -

Commits
-------

949c304 [DI] Fix undefined class in test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.