Skip to content
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

too many filters results in urls that are too long #689

Closed
haggertypat opened this issue Apr 16, 2012 · 7 comments
Closed

too many filters results in urls that are too long #689

haggertypat opened this issue Apr 16, 2012 · 7 comments

Comments

@haggertypat
Copy link
Contributor

As discussed here and here, IE doesn't support urls that are longer than about 2000 characters, and Apache's limit is 4000.

Even in Firefox I am experiencing strange behavior with 3500 character urls.

SonataAdmin urls get long very quickly. Each filter uses at least 33 characters: &filter[][type]=&filter[][value]=. Assume an average field name length of 8 and this number is close to 50 for each filter. This limits us to only 40 filters. Take into account domain names, extra characters for date filters, base SonataAdmin urls, and SonataAdmin programmers adding custom url parameters and this number is much lower.

40 or even 35 filters may seem high but I have an application in development with over 50.

@wjohnald
Copy link

Is there some way to change the filter form method to "POST"

@haggertypat
Copy link
Contributor Author

GET is more appropriate. Could we strip out unused filters from the url?

With this many filters, the interface itself can get pretty clunky. Something where you add the filters you want to use would be elegant, and resolve this issue:

http://rails-admin-tb.herokuapp.com/admin/division

@rande
Copy link
Member

rande commented Jan 23, 2013

rename filer => f, type => t and value => v can save 11 chars by filter, this can be an easy task and limit the current issue

@haggertypat
Copy link
Contributor Author

Renaming filter/value/type was going to cut down the character count by only about 25% (which wasn't enough) and the use of the three keys was spread across the project a bit, so I found another solution.

As a temporary solution for those who might run into the problem. I just remove the filters without values with jQuery on form submit. I'm probably an edge case here with 50 filters, but thought I'd share my workaround.

@webdevilopers
Copy link
Contributor

👍

@core23
Copy link
Member

core23 commented Mar 15, 2019

This issue is very old. Can you please check this against the latest stable / master version?

Feel free to reopen, if the error still exists.

A PR would be welcome if you reopen this issue.

@core23 core23 closed this as completed Mar 15, 2019
@webdevilopers
Copy link
Contributor

Sorry, but I'm no longer working on this project.

ft-1408 pushed a commit to intexsys/SonataAdminBundle that referenced this issue Sep 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants