-
-
Notifications
You must be signed in to change notification settings - Fork 895
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
[2.7] Class "ApiPlatform\Core\Bridge\Elasticsearch\DataProvider\Extension\ConstantScoreFilterExtension" not found #5005
Comments
This is how we managed to deprecate the old namespace, it should work without hassle. see https://github.com/api-platform/core/blob/2.7/src/deprecation.php#L442 Or is it using autowiring? |
hey @soyuka . |
it's a hack we use and that works if you've an issue with autowiring or a php error let me know we don't cover IDE issues. |
@soyuka this is not an IDE issue, but a real runtime issue. As explained by @rendler-denis it happens with autoloading, and in my case the error is triggered by my test suite. So not an error that can be ignored (IDE, phpstan, etc.) but an issue preventing running the app. Can you reopen? |
hey, @soyuka I do not understand what do you mean by IDE issue? |
Please send me a reproducer. All the classes and interfaces that are mentioned here have aliases. We fixed some of them we forgot and they're available in the new 2.7.1 version. Please update and let me know how I can help. @rendler-denis unless I have a typo in the class names you're showing here there's no issue on our end. What is your runtime error and how can I reproduce?
This is done on purpose in our code to trick the php namespace behavior in thinking the class is correctly defined. We're aliasing the class using class-alias. |
The file: ttps://github.com/api-platform/core/blob/2.7/src/deprecation.php#L442 says that the classes are deprecated. ` ` Any ideas how to use Elasticsearch in 2.7? |
@soyuka, apologies for the delay, please find the reproducer here. When creating the reproducer, I noticed the error started when I requested a sub-resource URL. Since there is no subresource provider for elasticsearch, I created my own DataProvider which re-uses the elasticsearch collection provider. On v2.7.2 the error goes away when I decorate the service, instead of injecting the provider as an argument: from: services:
App\ApiPlatform\DataProvider\MyCollectionDataProvider:
arguments:
$collectionDataProvider: '@api_platform.elasticsearch.collection_data_provider' to services:
App\ApiPlatform\DataProvider\MyCollectionDataProvider:
decorates: 'api_platform.elasticsearch.collection_data_provider' However, this changes the output of the test.
|
If there's a solution requiring changing something on my end, without migrating to the new metadata system, I'm open for suggestions :) |
friendly ping @soyuka. Would love to get started on the v2.7 to v3 migration :) |
@soyuka @alanpoulain @dunglas @vincentchalamon anyone? |
Any news on this? |
#5283 fixed the issue for me! Thanks a lot @vincentchalamon |
When upgrading
2.6.8
to2.7.0
and running my existing test suite, I get the following error:The text was updated successfully, but these errors were encountered: