EasyAdminBundle icon indicating copy to clipboard operation
EasyAdminBundle copied to clipboard

Doctrine Exception Sorting by AssociationField in EasyAdmin

Open jgniecki opened this issue 2 years ago • 4 comments

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.

jgniecki avatar Dec 23 '23 19:12 jgniecki

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

Natizyskunk avatar Jan 29 '24 16:01 Natizyskunk

no news on this ? thanks

ivanmunozruiz avatar Mar 11 '24 06:03 ivanmunozruiz

Anyone here managed to solve this issue ?

maelanleborgne avatar May 20 '24 15:05 maelanleborgne

same issue here

tsiatka avatar Aug 05 '24 10:08 tsiatka