Closed (fixed)
Project:
Drupal core
Version:
4.7.0
Component:
base system
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
10 Feb 2006 at 18:49 UTC
Updated:
17 May 2006 at 16:30 UTC
In Drupal 4.6.5, tablesort_get_querystring() treats "virtual" arrays in the request string (either GET or POST) as a query string. The code for that function didn't change for Drupal 4.7.0, so it has the same problem.
For example, if my query string is like the following:
?colors[red]=f00&colors[green]=0f0&colors[blue]=00f&prefered=blue
Once processed by the current tablesort_get_querystring(), it will return this:
?colors=Array&prefered=blue
The patch attached to this post corrects tablesort_get_querystring() with a helper function _tablesort_get_querystring().
| Comment | File | Size | Author |
|---|---|---|---|
| tablesort-remi-1.diff | 1.44 KB | remi |
Comments
Comment #1
markus_petrux commentedIs this the same issue reported here?
http://drupal.org/node/48258
I would say dup, but your giving a patch here.
Comment #2
remi commentedI searched before posting. Honest!
Anyway, thanks for pointing that out. I've been running Drupal all day with that patch today and haven't encountered a problem yet.
Comment #3
markus_petrux commentedremi: your patch is quite interesting and it may help to build the new querystring more correctly (ie. dealing with arrays passed via POST), however the main problem seems to be have been indirectly addressed (see 48258).
Please, let me mark this a dup now. We can continue discussion on the other issue, if anything else needs to be done.
Comment #4
moshe weitzman commentedi think the main issue for this bug is http://drupal.org/node/48834.
Comment #5
rkerr commented(Reopening, since Moshe has marked the other issue as a dupe of this one)
I would suggest some minor reformatting of the patch to match Drupal's coding guidelines
http://drupal.org/node/318
Also, I would think you should use is_array() instead of gettype() == 'array' to decide variable types. And instead of nesting an else { if { } } you could probably switch it to an elseif.
Otherwise, seems like it should fix the problem.
Comment #6
markus_petrux commented>> since Moshe has marked the other issue as a dupe of this one
Nope. Not a dup of this one, but a dup of:
http://drupal.org/node/5371
Comment #7
moshe weitzman commentedthis got fixed finally during drupal_get_destination fix
Comment #8
(not verified) commented