Skip to content
Browse files

MDL-8569 - mod/data sorting by numerical field now works with PostgreSQL

Author: Luke Hudson <luke@catalyst.net.nz>
  • Loading branch information...
1 parent 4a7030e commit b99b25ea04c0036de8d106b73d789bc8ea122965 cataluke committed Apr 18, 2007
Showing with 2 additions and 2 deletions.
  1. +2 −2 mod/data/view.php
View
4 mod/data/view.php
@@ -375,15 +375,15 @@
$sortcontent = $sortfield->get_sort_field();
$sortcontentfull = $sortfield->get_sort_sql('c.'.$sortcontent);
- $what = ' DISTINCT r.id, r.approved, r.userid, u.firstname, u.lastname, c.'.$sortcontent.' ';
+ $what = ' DISTINCT r.id, r.approved, r.userid, u.firstname, u.lastname, c.'.$sortcontent.', '.$sortcontentfull.' AS _order ';
$count = ' COUNT(DISTINCT c.recordid) ';
$tables = $CFG->prefix.'data_content c,'.$CFG->prefix.'data_records r,'.$CFG->prefix.'data_content c1, '.$CFG->prefix.'user u ';
$where = 'WHERE c.recordid = r.id
AND c.fieldid = '.$sort.'
AND r.dataid = '.$data->id.'
AND r.userid = u.id
AND c1.recordid = r.id ';
- $sortorder = ' ORDER BY '.$sortcontentfull.' '.$order.' , r.id ASC ';
+ $sortorder = ' ORDER BY _order '.$order.' , r.id ASC ';
$searchselect = '';
if (!empty($advanced)) { //If advanced box is checked.

0 comments on commit b99b25e

Please sign in to comment.
Something went wrong with that request. Please try again.