Skip to content
This repository has been archived by the owner on Feb 4, 2023. It is now read-only.

Showing all entries does not work #961

Open
knallcharge opened this issue Sep 16, 2020 · 2 comments
Open

Showing all entries does not work #961

knallcharge opened this issue Sep 16, 2020 · 2 comments

Comments

@knallcharge
Copy link
Contributor

knallcharge commented Sep 16, 2020

Hi,

I'm having a strange error when trying to show all entries in a datatable.
This is my length_menu:
'length_menu' => [[10, 25, 50, 100, -1], ['10', '25', '50', '100', 'All'],
The dropdown shows the correct numbers and works for 10, 25, 50, 100 but not for "All" and it shows an error when reloading the page after setting the length to "All".

More detail:
Loading the page with the page length set to "10" and then switching to "All" will only show 50 entries (while having 2,5k in my DB).
The same applies to the other setting, the shown number is always "page_length * 5" (showing 125 when set to 25, reloading page, switching to "All", 250 with 50 and 500 with 100).
(If I don't reload the page, the maximum number stays the same, e.g. reload page with "10", set to "All" will show 50, not reloading the page but setting the length to 25 first and the again to "All" will again only show 50.)

Then: While the above only applies while reloading the page with a number set in the dropdown, if I set the dropdown to "All" and then reload the page, the query is somehow broken, I get an "SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '-5' at line 1" in the Symfony toolbar, the relevant part of the query being "ORDER BY m0_.id DESC LIMIT -5".

Can anybody reproduce this or lead me to a solution? Can't believe this has never happened to anybody, or is nobody using the "All"-option with page_length?

@knallcharge
Copy link
Contributor Author

Looked further, because the factor 5 struck me and found something: I'm setting the pipeline in the AJAX options ('pipeline' => 5), removing this will resolve the issue (but of course disable ajax caching which I'd like to use).
Still considering this a bug, so I'll leave this open.

@Seb33300
Copy link
Collaborator

I was encountering issue when working with thousand of line and trying to display all on a SQL Server database.

The issue was fixed in Doctrine ORM 2.7.0
doctrine/orm#7829

But maybe not related

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants