Open BriceFab opened 1 year ago
Same error here
I've created a reproducible repo. https://github.com/parijke/ea-bug
Just install, open the Teachers and try to sort on Student
I have the same problem, it is related to naming of the reference column. Looks like a bug, ether in the Entity Annotation or Easy Admin mapping this.
The problem seem to be existing also in a case where you have a To-Many relation (from Post to Categories) and then apply this in the Post Crud:
public function configureCrud(Crud $crud): Crud
{
/** @var Crud $crud */
$crud = parent::configureCrud($crud);
$crud->setDefaultSort([
'category' => 'ASC',
]);
return $crud;
}
It does not lead to a correct filtering by any means. Instead, it remains to be sorted by the ID of the given post. Attempting to do second-level filtering (i.e. category.id
) result in an error:
Cannot select distinct identifiers from query with LIMIT and ORDER BY on a column from a fetch joined to-many association. Use output walkers.
I am experiencing an issue when using the
setPaginatorUseOutputWalkers(true)
configuration option in theconfigureCrud
method of EasyAdmin. It is causing the following SQL error:However, the
tree_root
column is present and properly registered in the database. If I set the walker tofalse
, I do not encounter any errors.I am using the Soft Doctrine Tree Extension bundle in conjunction with EasyAdmin: https://github.com/doctrine-extensions/DoctrineExtensions/blob/main/doc/tree.md
Steps to reproduce:
setPaginatorUseOutputWalkers(true)
Expected behavior: No SQL error should occur when using the
setPaginatorUseOutputWalkers(true)
configuration.Actual behavior: The SQL error mentioned above is thrown.
Additional information:
Please let me know if you need any further information. Thank you.