diff --git a/tests/php/test_filter_events_sort.php b/tests/php/test_filter_events_sort.php new file mode 100644 index 0000000000..27a7cc1f10 --- /dev/null +++ b/tests/php/test_filter_events_sort.php @@ -0,0 +1,46 @@ +test_pre_sql_conditions()) { @@ -864,7 +884,8 @@ class Filter extends ZM_Object { $where = $this->sql() ? ' WHERE ('.$this->sql().')' : ''; // $where = ' WHERE ( T.Name = "Bird" )'; - $sort = $this->sort_field() ? $this->sort_field() .' '.($this->sort_asc() ? 'ASC' : 'DESC') : ''; + $sort_sql = self::events_sort_sql($this->sort_field()); + $sort = $sort_sql ? $sort_sql.' '.($this->sort_asc() ? 'ASC' : 'DESC') : ''; $col_str = ' E.*,