core icon indicating copy to clipboard operation
core copied to clipboard

Missing interface after minor upgrade

Open OskarStark opened this issue 2 years ago • 1 comments

API Platform version(s) affected: x.y.z I am on version 2.6.8

Description
The interface ApiPlatform\Core\Bridge\Doctrine\Orm\Util\QueryNameGeneratorInterface was present in 2.6.8 but hard moved in 2.7.0 to ApiPlatform\Doctrine\Orm\Util\QueryNameGeneratorInterface. It is easy to fix, but it looks like a BC break to me. The interface was not experimental or internal.

Checking the CHANGELOG, the Core namespace was removed in 3.0 beta 🤔 not in 2.7.0

How to reproduce

Possible Solution
Add it back with a deprecation

Additional Context

OskarStark avatar Sep 20 '22 17:09 OskarStark

it is aliased and deprecated: https://github.com/api-platform/core/blob/2.7/src/deprecated_interfaces.php#L37

soyuka avatar Sep 21 '22 07:09 soyuka

Hi @soyuka & @OskarStark ,

The service is aliased, but I think @OskarStark implements a class with this interface.

yobrx avatar Sep 22 '22 15:09 yobrx

Are you using autowiring and we forgot an alias?

soyuka avatar Sep 23 '22 15:09 soyuka

Facing the same issue after 2.7.0 migration

aelfannir avatar Sep 23 '22 15:09 aelfannir

The service is aliased, but I think @OskarStark implements a class with this interface.

Exactly and it does not have the "hack" like other classes with the class_exists wrapper

OskarStark avatar Sep 23 '22 16:09 OskarStark

Similar happened to me for this interface: ApiPlatform\Core\Api\UrlGeneratorInterface

which was hard moved in 2.7 to ApiPlatform\Api\UrlGeneratorInterface

usu avatar Sep 25 '22 06:09 usu

Yes same for me in another project

OskarStark avatar Sep 25 '22 08:09 OskarStark

The ApiPlatform\Core\Bridge\Doctrine\Orm\Util\QueryNameGeneratorInterface is used inside the ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\FilterInterface and throughout all classes using the FilterInterface. Since it was moved, these are now importing an undefined class. Although that might "work" because of aliasing, you will get an error from your IDE, e.g. when implementing a custom filter.

So adding it back with a deprecation, as @OskarStark already pointed out, should fix this issue.

bytecast-de avatar Sep 27 '22 08:09 bytecast-de

we don't cover ide errors sorry

These interfaces are aliased and we kept a bc-layer in 2.7. If you've a PHP error please let me know.

soyuka avatar Sep 29 '22 08:09 soyuka