Replies: 11 comments
-
|
It's linked to autowiring not able to use |
Beta Was this translation helpful? Give feedback.
-
|
To me this seems like a Symfony bug. |
Beta Was this translation helpful? Give feedback.
-
|
Experiencing the same. Workaround is to disable autowiring/autoconfigure and add a tag manually ( |
Beta Was this translation helpful? Give feedback.
-
|
Hi everyone, |
Beta Was this translation helpful? Give feedback.
-
|
I specified 2 workarounds in the issue description: either disable autowire/autoconfigure of your custom filter or avoid overriding the constructor, replace it with setters, for example. |
Beta Was this translation helpful? Give feedback.
-
|
Yes I tried your workarounds but I use a custom doctrine filter that Unused binding "$requestStack" in service "filter.my_custom_filter". Here's my yml just in case: Filter example : https://api-platform.com/docs/core/filters/#creating-custom-doctrine-orm-filters Thanks in advance for your help |
Beta Was this translation helpful? Give feedback.
-
|
@quentinphilbert Do you have a custom constructor? This problem should only happen if you have a custom constructor. Anyway, this looks weird to me: parent: 'App\Filter\MyCustomFilter'Are you sure that's what you intended? |
Beta Was this translation helpful? Give feedback.
-
|
Your filter configuration doesn't look correct: |
Beta Was this translation helpful? Give feedback.
-
|
@quentinphilbert If you're following the docs, just use |
Beta Was this translation helpful? Give feedback.
-
|
Thanks guys it's all good now. I used : And this constructor : It works fine but the only problem I have now is that my filter doesn't show up in the responses of my GETs (it was in "hydra:search" and now there's nothing) but it's really minor. Thanks again ! |
Beta Was this translation helpful? Give feedback.
-
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
After updating to v2.4.3 I started getting
Unused binding "$requestStack" in service "Extended\From\AbstractFilter\MyFilter"error.Here is my config:
And the filter pseudocode:
I was able to fix the error by switching off
autowireandautoconfigurefor the service:The further research showed me that the problem is in the overridden constructor.
If I remove the constructor then autowiring works with the original service definition.
Looks like this issue was introduced by #2664
Beta Was this translation helpful? Give feedback.
All reactions