api-platform / core

The server component of API Platform: hypermedia and GraphQL APIs in minutes
https://api-platform.com
MIT License
2.45k stars 876 forks source link

2.6.3 Eloa Enum no longer works with SearchFilter #4135

Closed crbanman closed 3 years ago

crbanman commented 3 years ago

API Platform version(s) affected: 2.6.3

Description
As of 2.6.3, using enums from elao/enum (v1.14.0) with the search filter no longer works and throws a 500 error.

(I did notice that this was never officially supported. So maybe a custom filter is in order.)

How to reproduce
Have an entity that contains an eloa/enum field and add a search filter for it.

/**
 * ...
 * @ApiFilter(SearchFilter::class, properties={"enumField": "exact"})
 */
class MyEntity {
    // ...

    /**
     * @ORM\Column(type="custom_type_enum")
     */
    public $enumField;

    // ...
}

A query against the entity collection using the filter throws a 500 error.

Possible Solution
If there's a new bug was not introduced, a custom filter may need to be created (possibly out of scope for core).

soyuka commented 3 years ago

same issue as #4128

soyuka commented 3 years ago

closing as duplicate