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

prepends "/?=undefined&" in url, removes all filters and redirect to "?e=1" #9

Open
peppelinux opened this issue Mar 15, 2017 · 1 comment

Comments

@peppelinux
Copy link

If I set a datetime or a date filter as frst selection

/?creation_date__gte=2017-03-08+00%3A00%3A00%2B01%3A00&creation_date__lt=2017-03-16+00%3A00%3A00%2B01%3A00

then if I select a dal admin filters of mine the new window location is:

/?=undefined&creation_date__gte=15%2F03%2F2017&creation_date__lte=15%2F03%2F2017&tipo_marketing=3

the erroneous "/?=undefined&" drive the window location in a new url with "?e=1" and all the previosly selected filters removed.

This happens only if a datetime filter preceeds a dal filter, if other sequence of filter appended in url this bug will not be raised.

Actually tested on two different Django platforms

@peppelinux
Copy link
Author

peppelinux commented Mar 15, 2017

Th bug appears when in the url, in window.location.search, the date filters contains hours and minutes notation lke the previouse examples or a & as prefix, like this example:

?&creation_date__gte=16%2F03%2F2017&creation_date__lte=16%2F03%2F2017

The previous bug disappears if the window.location.search is like this:
/?creation_date__gte=2017-03-08&creation_date__lt=2017-03-16

I fixed this bug in js file querystring.js, at line 48, this way:

  for (var i = 0; i < q.length; i++) {
    
    // prevents undfined "?e=1" redirects
    if (q[i].length < 1) { continue; }

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

1 participant