Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
If I'm on /events?month=12&year=2012, and I have an exposed filter for content type, clicking apply only passes the content type, not the month or year.
Comment | File | Size | Author |
---|---|---|---|
#12 | views-fix-get-querystring-1359798-12.patch | 894 bytes | nod_ |
#8 | views-fix-get-querystring-1359798-8.patch | 890 bytes | nod_ |
#7 | views-fix-get-querystring-1359798-7.patch | 863 bytes | nod_ |
#1 | views-1359798-1.patch | 352 bytes | tim.plunkett |
Comments
Comment #1
tim.plunkettThis fixes it, not sure if its the proper fix.
Comment #2
dawehnerI can reproduce the bug by using this view and adding ?t=123 in the queue
Yes your patch solves the issue, but i have no idea whether this is the right fix, how can we find that out?
Comment #3
dawehnerHere is some documentation from http://www.w3.org/TR/Window/
This attribute represents the query portion of a URI. It consists of everything after the pathname up to and excluding the first hash mark (#).
This seems to make sense, what do you think?
Comment #4
tim.plunkettWell I debugged it and rolled the patch, so I'm a little biased :)
It makes sense to me though.
Comment #5
dawehnerSo i just committed it :)
Comment #6
nod_This patch breaks every single ajax views when clean urls are off.
With the patch the url looks like this :
/?q=views/ajax?q=exposed-ajax
instead of/?q=views/ajax
. First might want to check if?
is already in the url and thatq
isviews/ajax
and not the page/panel/whatever URL.The checks sounds good enough, but I'm not sure it is.
Comment #7
nod_Looks like this patch handle whatever I throw at it with clean urls on or off. Please confirm.
Comment #8
nod_Fix doc style.
Comment #9
dawehnerIsn't there a drupal function for doing this? Maybe not because drupal just uses the internal drupal path. I'm wondering whether it would be possible to add a seperate function so it's kind of easier to maintain/understand
Comment #10
nod_Well the drupal js landscape is pretty arid, nothing remotely close of doing that in core. The only other solution would be to set this stuff in PHP. js-wise I don't think you'd be able to make that much simpler if you want to cover all use cases.
I'm not very familiar with drupal php function to get arguments, could be something to look at.
Comment #11
nod_Instead of JS, in
theme.inc
line 124 that could work:But after the first call it add a
status
parameter. Don't know where that comes from.Comment #12
nod_The PHP solution is not that good after all. It puts all fields values in the url, but only values from the first submit, the following requests keeps the same URL. I mean it works, it's just that what is in the URL is pretty much useless. And I still see the issue of double "?" in the URL too but this time it doesn't crash.
To get more or less the same behavior you'd need to go with JS. The JS code might not be the clearest (really the weirdest here is the regex) but at least it doesn't confuse people with useless GET parameters that are not used.
I've edited a bit the JS, a tiny bit clearer.
Comment #13
nod_It might have been better to open a different issue, since I already took over I'm just changing the title to reflect what's going on.
Comment #14
dawehnerThanks for working out this patch!
I tested this with clean urls enabled and disabled and the stuff which are done in the debugger looked fine.
Committed to 7.x-3.x
Comment #15
nod_Thanks a lot :D
I've been playing around to implement ajax history/bookmarking and this functionality get in the way pretty bad. Not possible to use as-is. I'm not saying to change, I'm just warning that it's not the end of it and there might be a couple of people looking for this.
This week I'll have a little something to show in #343535: Enable bookmarking of AJAX views and I might explain a bit more the issue with this.
Comment #16
dawehnerA patch for the other issue would be cool!
Comment #17
troutdun CreditAttribution: troutdun commentednod_,
Thanks much for this fix. I upgraded to 7.x-3.0 on 12/28 and didn't realize that AJAX was broken (was using sorted columns in a view) until this week. I'm a real Drupal novice, but I was able to apply your patch and get my site back to full functionality with this when I applied this patch today.
PS: I'm not sure if it's considered proper to chime in with confirmation of functionality after the patch has been committed to the dev code train by dereine, but figured another data point wouldn't hurt.
Comment #18
longwaveThis patch seems to be the cause of #1376686: Error with Ajax enabled views in admin overlay for jQuery 1.7 and Views 3, see comment #13 in that issue.
Comment #19
nod_Have you tried -dev or my patch ?
Comment #20
longwave(ignore, I made a mistake)
Comment #21
longwaveBack to fixed, sorry for the noise
Comment #22
sreynen CreditAttribution: sreynen commentedI'm not sure what mistake longwave made, but I think the relationship between this and #1376686: Error with Ajax enabled views in admin overlay for jQuery 1.7 and Views 3 was not an error. Both -dev and 7.x-3.0 seem to have the patch in #12 applied, and this patch (in combination with the earlier patch in #1) seem to be the cause of the new AJAX parse error, as reverting the changes in those patches makes the error go away. I'll document the rest of what I've found in the newer thread, but I wanted to ping here in case those who wrote the patch are better able to debug it than I've been.