-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[2.8] Deprecation notice when using factory_service/factory_method #14687
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
To get a more sensible deprecation message, we will have to trigger them in the loader classes. However, this would mean that one one get two messages, one from the loader and one from the I see two solutions to get rid of the double message:
|
Just add to the deprecation message in the Definition that it could also be caused by using |
Another question related to this though, I have fixed all my application usages, but composer is still complaining. I suspect this is coming from a third-party bundle, but I am not sure which or where just yet. The problem is that I can't suppress those warnings in composer and it will cause a deployment failure on the |
@Tobion Though you would still not know which file actually causes the issue. Given that the warning can also be triggered by a third-party bundle, this could become hard to debug imho. |
@xabbuh true |
@xabbuh calling |
…ameters given (iltar) This PR was merged into the 2.7 branch. Discussion ---------- [2.7][DI] Definition deprecation notice includes the parameters given | Q | A | ------------- | --- | Deprecations? | yes | Tests pass? | yes | Fixed tickets | #14687 | License | MIT This PR won't fix the issue at hand, but should make it a bit easier to debug. Because this is used by the configuration loader, it's hard to trace back where and how it's actually used. Commits ------- b322d46 Definition deprecation notice includes the parameters given
I've had similar problems as @iltar with composer/warmup spamming with deprecations - afair it was caused by sonata admin dependency and as a quick fix I placed |
Having better error messages would be great, even in 2.7.x releases IMO. I wouldn’t mind the duplicate too much. |
see #14798 |
Is there a way to filter the deprecation messages that comes from the application code ( |
…using deprecated configuration options (xabbuh) This PR was merged into the 2.7 branch. Discussion ---------- [DependencyInjection] provide better error message when using deprecated configuration options | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #14687 | License | MIT | Doc PR | Commits ------- e1e7440 [DependencyInjection] provide better error message when using deprecated configuration options
Starting on a PR regarding another issue and I hooked up on of my applications to 2.8 instead of 2.6. For me this was 2 seconds to figure out it was caused by the old way of defining a factory service + method, but the error message might cause a lot of confusion for others. The message is thrown in the Definition class rather than the place where you expect it (Yaml Loader in this case).
The fix for this is to change your service definition:
The thing is that the error message below does not clearly reflect that. I don't think it's desired to put this information in the message below, but maybe someone has a nice idea where to put it instead.
The text was updated successfully, but these errors were encountered: