this has been driving me nuts. when you filter a query in the issue queue (either via the form elements, or the advanced search page), the resulting pager links can lose track of your query. for example:
- http://drupal.org/project/issues/3060 (issues for core)
- select "active" in the status and "bug reports" in the category; hit "search"
- you see only active bugs for drupal core. so far, so good.
- however, if you hit "next" at the bottom of the page, you lose the fact you want to see active bugs, and you just see page 2 of the all-issues listing. :(
because of a partially working solution to this problem (#69626), this all sort of works right if you start at http://drupal.org/project/issues/drupal instead. however, it's still broken if you start at advanced search or if you use the nid. :(
attached patch fixes this (thanks to merlinofchaos for lots of help, encouragement, and wisdom on this). all the weird $_SESSION stuff from #69626 (which i'll admit is only there because i asked the patch author to try to get a solution working that didn't use big ugly URLs) is now gone. i've come full circle on this (also thanks to merlin), and think the big URLs are a feature (once you filter the view) since at least you can then cut/paste the URL and show other people the same view of the data you're looking at. furthermore, the inconsistencies and buggy behavior are now gone, via this cleaner approach.
the reasons i'm posting this as "needs work":
- things are still fubar with the "my issues" page (e.g. http://drupal.org/project/issues/user). if you select any filters via that form, it still forgets you're on "/project/issues/user" and it shows you all issues. there's another issue specifically about this, but it think it should probably be solved with the exact same approach as the rest of this patch.
- if you start at /project/issues/3060, once you select some filters and press "submit", you end up seeing the full URL with your filter choices in it (since it redirects you to /project/issues/drupal so that the name matches the value of "project" selected in the drop-down, the main bug #69626 sucessfully fixed). however, it'd be nice to display the full URL like this, even if you start on /project/issues/drupal in the first place.
- in the name of safety, we wrap the filters in
drupal_query_string_encode(). unfortunately, if you select multiple values of a given filter (e.g. from the adv. search page), it makes the commas between these values really hard to read, and makes the URL much less human-readable. it's still valid and it works, but it's much more ugly than needed. i think i'd like to handle this differently and only calldrupal_query_string_encode()on the individual values, before weimplode()the array with ','...
otherwise, this seems to solve all our pager + filter problems. i've installed this patch on scratch.drupal.org, if you want to play with it there.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | project_issue_pager_links.patch_1.txt | 5.88 KB | dww |
| project_issue_pager_links.patch.txt | 4.71 KB | dww |
Comments
Comment #1
dwwnew patch fixes "my issues".
the cosmetic stuff is still broken (e.g. the way-too-ugly escaped commas and the not-ugly-enough URLs in some cases). however, everything *actually works* now. ;) i'd be happy for insight on any of these minor cosmetic things, but i'm tempted to just commit this to fix the majorly broken behavior...
Comment #2
dwwUnConeD pointed me to http://www.ietf.org/rfc/rfc2396.txt for the explaination of why the commas are getting escaped. :( we can worry about that and the GET-based URL cleanup stuff in another issue.
committed this to DRUPAL-4-7--2 and updated on d.o.
i'm so glad to have this fixed!
Comment #3
dwwbackported this to DRUPAL-4-7 (revision: 1.172.2.24) since all of these bugs exist there, too.
Comment #4
dwwin IRC folks both pointed out a few random cases that still weren't working quite right:
both are now fixed in DRUPAL-4-7--2 (backported to DRUPAL-4-7) and installed on d.o.
see http://drupal.org/cvs?commit=45599 and http://drupal.org/cvs?commit=45608 for details.
Comment #5
(not verified) commented