Closed (fixed)
Project:
Views (for Drupal 7)
Version:
7.x-3.x-dev
Component:
table style
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
15 Jun 2011 at 04:08 UTC
Updated:
11 Oct 2011 at 21:21 UTC
Jump to comment: Most recent file
Comments
Comment #1
infojunkieThis patch fixes the problem for both 6.x-3.x and 6.x-2.x (with offset).
It uses
parse_strto manipulate$queryas an array, which is easier to handle than a string, thenhttp_build_queryto convert the result back to a string when it's done.Comment #2
dwwYes, good catch. I just ran into the same problem myself.
Also, the same patch fixes a related bug, which is that if you have an exposed filter with an exposed operation, that element of
$view->exposed_raw_inputwill be a nested array, not just a string, so you end up with the following:notice: Array to string conversion in /.../sites/all/modules/views/theme/theme.inc on line 415.
Using parse_str for this seems like a really simple, elegant solution (make PHP do the heavy lifting) and it mostly works nicely in my testing (V3 -- I haven't tested V2 yet).
One related thing that appears to be broken is the following sequence:
- load the raw table view
- click on a different column to sort than the default sort
- select a value for an exposed filter and submit
At this point, the filter is applied, but the clicked sort order is lost. However, the same is true before the patch, so it's definitely not making this worse. Not sure if there's already an issue open about that (probably there is).
However, I don't want to commit and push this without dereine or merlin's approval, since this would be the first time views uses parse_str() and Earl might hate this for some reason. ;) But, it's RTBC to my eyes, and hopefully I can get Earl's sign-off ASAP so we can fix this up soon.
Thanks!
-Derek
p.s. You should have searched first since you would have hopefully found #1141392: exposed filters and table sort not getting along which I believe is the same bug. However, since this issue is more clear about the problems and already has a working patch, I'm going to mark that one as duplicate.
Comment #3
dawehnerCommited to both 6.x branches and wondering whether the bug still exist on 7.x-3.x
Comment #4
jvdurme commentedThanks for this fix!
Comment #5
dawehnerThis seems to be fixed in 7.x-3.x already.