diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-10-15 04:34:15 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-10-15 04:34:15 +0000 |
commit | 66ec59e0f4179e2ab5630bb00bf20ba3fdab5ba6 (patch) | |
tree | 89475c31a147161b27618de2cfac9411a8fb8efa /includes | |
parent | 34a78487496accce366a43f3222854172ab8269b (diff) | |
download | brdo-66ec59e0f4179e2ab5630bb00bf20ba3fdab5ba6.tar.gz brdo-66ec59e0f4179e2ab5630bb00bf20ba3fdab5ba6.tar.bz2 |
#664042 by coltrane, effulgentsia: Fixed TableSort order error when no sort set in header
Diffstat (limited to 'includes')
-rw-r--r-- | includes/tablesort.inc | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/includes/tablesort.inc b/includes/tablesort.inc index cd0136bc1..960bd2f0d 100644 --- a/includes/tablesort.inc +++ b/includes/tablesort.inc @@ -128,12 +128,14 @@ class TableSort extends SelectQueryExtender { } else { // The first column specified is initial 'order by' field unless otherwise specified - if (is_array($this->header[0])) { - $this->header[0] += array('data' => NULL, 'field' => NULL); - return array('name' => $this->header[0]['data'], 'sql' => $this->header[0]['field']); + $headers = array_values($this->header); + $header = $headers[0]; + if (is_array($header)) { + $header += array('data' => NULL, 'field' => NULL); + return array('name' => $header['data'], 'sql' => $header['field']); } else { - return array('name' => $this->header[0]); + return array('name' => $header); } } } |