EasyAdminBundle icon indicating copy to clipboard operation
EasyAdminBundle copied to clipboard

Support for objects in ChoiceField

Open chapterjason opened this issue 8 months ago • 0 comments

I currently working on a project which uses the oauth server and clients from league. The server is using values objects for grants, redirect uris and scopes.

Just by using a ChoiceField I got the error:

Uncaught PHP Exception TypeError: "Cannot access offset of type League\Bundle\OAuth2ServerBundle\ValueObject\Grant on array" at ChoiceConfigurator.php line 142 {"exception":"[object] (TypeError(code: 0): Cannot access offset of type League\\Bundle\\OAuth2ServerBundle\\ValueObject\\Grant on array at [...]/vendor/easycorp/easyadmin-bundle/src/Field/Configurator/ChoiceConfigurator.php:142)"} []

This is a simple fix to provide support for any object which implements stringable.

chapterjason avatar Mar 09 '25 18:03 chapterjason