Skip to content

Declaring a filter via Parameter logs an exceptionΒ #7361

@ameotoko

Description

@ameotoko

API Platform version(s) affected: 4.1.20

Description
When a Filter is added to an Operation as described in the docs here, each filter declaration logs an exception:

ManagerRegistry must be initialized before accessing it.
Image

How to reproduce
The setup involves two API resources:

#[ApiResource]
class Event
{    
    #[ORM\Id]
    #[ORM\GeneratedValue]
    #[ORM\Column]
    private ?int $id = null;
#[ApiResource(
    new GetCollection(
        parameters: [
            new QueryParameter(
                key: 'event',
                filter: new NumericFilter(),
                property: 'event.id'
            )
        ]
    ),
)]
class Media
{
    #[ORM\Id]
    #[ORM\GeneratedValue]
    #[ORM\Column]
    private ?int $id = null;

    #[ORM\ManyToOne]
    private ?Event $event = null;

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions