Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
Fix bug when using an private aliased factory service#17942
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
| } | ||
| return$currentId ===$factoryService ?$newId :$currentId; | ||
| return$currentId ===$factoryService ?$newId :$factoryService; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
$currentId is the current ID of the removed alias, while$factoryService is the original ID of the factory service.
If the factory service equals the ID of the removed alias, it should be updated to become the actual service ID. However, if the factory service does not equal the ID of the removed alias, the original value should be used.
With the old code, it was always replacing the original code, either with the actual definition ID or the ID of the removed alias (which was causing the troubles people were reporting).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
good catch@wouterj 👏
xabbuh commentedFeb 27, 2016
👍 Oh my God, what a silly mistake. Thanks Wouter for the fix! Status: Reviewed |
linaori commentedFeb 27, 2016
Was the test failing before? If not, a test would be nice to prevent this bug from happening again |
wouterj commentedFeb 27, 2016
@iltar I've added a test now (although this is a very specific test, so I'm not 100% sure if we should include it). |
| $this->assertSame('b_alias',$aDefinition->getFactoryService()); | ||
| } | ||
| /** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
it's not really legacy in 2.3, but this makes things easier to merge to 2.7/2.8
fabpot commentedFeb 28, 2016
Thank you@wouterj. |
…terJ)This PR was squashed before being merged into the 2.3 branch (closes#17942).Discussion----------Fix bug when using an private aliased factory service| Q | A| ------------- | ---| Bug fix? | yes| New feature? | noBC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets |#17910,#17915| License | MIT| Doc PR | -/cc@xabbuhCommits-------de406c0 Fix bug when using an private aliased factory service
/cc@xabbuh