From 155e3ab3b560991e8dc5927980cf3286fd640601 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Mon, 3 Oct 2011 15:34:10 +0000 Subject: [PATCH] Fix error when sorting/filtering (showed up in timesheet) --- etemplate/inc/class.etemplate_widget_nextmatch.inc.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/etemplate/inc/class.etemplate_widget_nextmatch.inc.php b/etemplate/inc/class.etemplate_widget_nextmatch.inc.php index 61d1e0c827..3ea857a34e 100644 --- a/etemplate/inc/class.etemplate_widget_nextmatch.inc.php +++ b/etemplate/inc/class.etemplate_widget_nextmatch.inc.php @@ -137,6 +137,10 @@ class etemplate_widget_nextmatch extends etemplate_widget $value = array_merge($value, $filters); $result = array('rows' => array()); + // Parse sort into something that get_rows functions are expecting: db_field ASC/DESC + if(is_array($value['sort'])) + $value['sort'] = $value['sort']['id'] . ' ' . $value['sort']['asc'] ? 'ASC' : 'DESC'; + foreach ($fetchList as $entry) { $value['start'] = $entry['startIdx'];