api-platform / api-platform/core

Doctrine Orm Search Filter Error

Open
#8,060 4 comments 0 reactions 0 assignees View on GitHub
doctrine filters
Dominant language
PHP
Stars
2.6k
Forks
980
Avg merge
2d 5h
Merged PRs (30d)
48

Description

When using the SearchFilter for an exact match on an associated object the search fails.

"hydra:description": "Can't get a way to read the property \"id\" in class \"App\\Entity\\DirectDerm\\Organization\".",

Organization has organizationId as it's ORM\id

#[Groups([Organization::GROUP_READ])]
#[ORM\Column(name: 'organizationId')]
#[ORM\GeneratedValue]
#[ORM\Id]
private ?int $organizationId = null;

api-platform\core\src\Doctrine\Common\Filter\SearchFilterTrait.php line 127 is hardcoded to look for 'id'

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.