Paginator output walkers causing SQL error
I am experiencing an issue when using the setPaginatorUseOutputWalkers(true) configuration option in the configureCrud method of EasyAdmin. It is causing the following SQL error:
An exception occurred while executing a query: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'm0_.tree_root' in 'field list'
However, the tree_root column is present and properly registered in the database. If I set the walker to false, 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:
- Configure the CRUD with
setPaginatorUseOutputWalkers(true) - Perform a query that triggers pagination
Expected behavior:
No SQL error should occur when using the setPaginatorUseOutputWalkers(true) configuration.
Actual behavior: The SQL error mentioned above is thrown.
Additional information:
- Bundle version: easyadmin 4.6.X
- Symfony version: 6.2.X
Please let me know if you need any further information. Thank you.
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.