EasyCorp / EasyAdminBundle

EasyAdmin is a fast, beautiful and modern admin generator for Symfony applications.
MIT License
4.01k stars 1.02k forks source link

Doctrine Exception Sorting by AssociationField in EasyAdmin #6073

Open jgniecki opened 6 months ago

jgniecki commented 6 months ago

PHP 8.1, Symfony 6.3, EasyAdmin 4.8.6, Doctrine 2.17.2

Hello, I have a problem when trying to sort by this object:

AssociationField::new('personalData')

I'm getting the following exception:

Doctrine\ORM\Mapping\DefaultQuoteStrategy::getJoinColumnName(): Argument #1 ($joinColumn) must be of type array, bool given, called in /path/vendor/doctrine/orm/lib/Doctrine/ORM/Query/AST/Functions/IdentityFunction.php on line 70

User Entity:

#[ORM\OneToOne(mappedBy: 'user', cascade: ['persist', 'remove'])]
private ?PersonalData $personalData = null;

PersonalData Entity:

#[ORM\OneToOne(inversedBy: 'personalData', cascade: ['persist', 'remove'])]
#[ORM\JoinColumn(nullable: false)]
private ?User $user = null;

I generated both entities and their relationships using the console.

Natizyskunk commented 5 months ago

I've the exact same error. I'm using "easyadmin-bundle: v4.7"

ivanmunozruiz commented 4 months ago

no news on this ? thanks

maelanleborgne commented 2 months ago

Anyone here managed to solve this issue ?