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

Showing all entries does not work #961

Open
@knallcharge

Description

@knallcharge

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions