Permalink
Browse files

MDL-32126 replaced _order with sortorder to make sorting work in oracle

  • Loading branch information...
1 parent efdf99d commit 5af958a918a2d38409b999e5be050c0159931e52 @abgreeve abgreeve committed with stronk7 May 18, 2012
Showing with 4 additions and 4 deletions.
  1. +2 −2 mod/data/lib.php
  2. +2 −2 mod/data/view.php
View
4 mod/data/lib.php
@@ -3515,7 +3515,7 @@ function data_get_advanced_search_sql($sort, $data, $recordids, $selectdata, $so
}
$nestselectsql = 'SELECT r.id, r.approved, r.timecreated, r.timemodified, r.userid, u.firstname, u.lastname, ' . $sortcontentfull . '
- AS _order
+ AS sortorder
FROM {data_content} c,
{data_records} r,
{user} u ';
@@ -3541,4 +3541,4 @@ function data_get_advanced_search_sql($sort, $data, $recordids, $selectdata, $so
$sqlselect['sql'] = "$nestselectsql $nestfromsql $sortorder";
$sqlselect['params'] = $inparam;
return $sqlselect;
-}
+}
View
4 mod/data/view.php
@@ -540,7 +540,7 @@
$sortcontent = $DB->sql_compare_text('c.' . $sortfield->get_sort_field());
$sortcontentfull = $sortfield->get_sort_sql($sortcontent);
- $what = ' DISTINCT r.id, r.approved, r.timecreated, r.timemodified, r.userid, u.firstname, u.lastname, ' . $sortcontentfull . ' AS _order ';
+ $what = ' DISTINCT r.id, r.approved, r.timecreated, r.timemodified, r.userid, u.firstname, u.lastname, ' . $sortcontentfull . ' AS sortorder ';
$count = ' COUNT(DISTINCT c.recordid) ';
$tables = '{data_content} c, {data_records} r, {data_content} cs, {user} u ';
$where = 'WHERE c.recordid = r.id
@@ -550,7 +550,7 @@
AND cs.recordid = r.id ';
$params['dataid'] = $data->id;
$params['sort'] = $sort;
- $sortorder = ' ORDER BY _order '.$order.' , r.id ASC ';
+ $sortorder = ' ORDER BY sortorder '.$order.' , r.id ASC ';
$searchselect = '';
// If requiredentries is not reached, only show current user's entries

0 comments on commit 5af958a

Please sign in to comment.