-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SQL error opening lists page #44
Comments
Hi @iraldoad, |
I got the same issue , what could I do to fix it ? |
Hi @victoracho,
which means in the totals query
to add all of the selected fields, which are in the default case all fields of the entity.
Or you could just remove all Or If you don't want to do it manually for all generated files, you could extend index.html.twig and controller |
Thank you, I just deleted all of the totalofrecords occurrences and it worked, but the delete action seems to be blocked or something, will the bundle work normally without the things i just erased ? |
Hi @petkopara, Adding all the fields to the GROUP BY does not work for me, as the request now returns multiple results (one for each entry in the table, due to the grouping by id...) : "The query returned multiple rows. Change the query or use a different result function like getScalarResult()." Since the issue is indeed caused by the ORDER BY clause added when calling pagination(), the solution is to call getTotalOfRecordsString() before calling pagination() in indexAction() :
Note that it is required to clone the $queryBuilder. Otherwise, there will be an error in the paginator ("The Paginator does not support Queries which only yield ScalarResults."). |
Hello.
I generated a CRUD for an entity with two fields and when I try to access the list it throws me the following error.
SQLSTATE[42803]: Grouping error: 7 ERROR: la columna «n0_.id» debe aparecer en la cláusula GROUP BY o ser usada en una función de agregación
I'm using PHP 7.0.10, Symfony 3.3.2 and PostgreSQL 9.4.
The text was updated successfully, but these errors were encountered: