Skip to content
Browse files

Merge branch 'wip-MDL-36668-MOODLE_22_STABLE' of git://github.com/abg…

…reeve/moodle into MOODLE_22_STABLE
  • Loading branch information...
2 parents d59c0d7 + 6c31598 commit bf0aa894bdffbefd35c9e3d52a409dddd634cdf5 @danpoltawski danpoltawski committed Nov 22, 2012
Showing with 4 additions and 6 deletions.
  1. +4 −6 mod/data/view.php
View
10 mod/data/view.php
@@ -524,7 +524,7 @@
$what = ' DISTINCT r.id, r.approved, r.timecreated, r.timemodified, r.userid, u.firstname, u.lastname';
$count = ' COUNT(DISTINCT c.recordid) ';
- $tables = '{data_content} c,{data_records} r, {data_content} cs, {user} u ';
+ $tables = '{data_content} c,{data_records} r, {user} u ';
$where = 'WHERE c.recordid = r.id
AND r.dataid = :dataid
AND r.userid = u.id ';
@@ -555,8 +555,7 @@
$advparams = array_merge($advparams, $val->params);
}
} else if ($search) {
- $where .= ' AND cs.recordid = r.id ';
- $searchselect = " AND (".$DB->sql_like('cs.content', ':search1', false)." OR ".$DB->sql_like('u.firstname', ':search2', false)." OR ".$DB->sql_like('u.lastname', ':search3', false)." ) ";
+ $searchselect = " AND (".$DB->sql_like('c.content', ':search1', false)." OR ".$DB->sql_like('u.firstname', ':search2', false)." OR ".$DB->sql_like('u.lastname', ':search3', false)." ) ";
$params['search1'] = "%$search%";
$params['search2'] = "%$search%";
$params['search3'] = "%$search%";
@@ -571,7 +570,7 @@
$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 ';
+ $tables = '{data_content} c, {data_records} r, {user} u ';
$where = 'WHERE c.recordid = r.id
AND r.dataid = :dataid
AND r.userid = u.id ';
@@ -606,8 +605,7 @@
$advparams = array_merge($advparams, $val->params);
}
} else if ($search) {
- $where .= ' AND cs.recordid = r.id ';
- $searchselect = " AND (".$DB->sql_like('cs.content', ':search1', false)." OR ".$DB->sql_like('u.firstname', ':search2', false)." OR ".$DB->sql_like('u.lastname', ':search3', false)." ) ";
+ $searchselect = " AND (".$DB->sql_like('c.content', ':search1', false)." OR ".$DB->sql_like('u.firstname', ':search2', false)." OR ".$DB->sql_like('u.lastname', ':search3', false)." ) ";
$params['search1'] = "%$search%";
$params['search2'] = "%$search%";
$params['search3'] = "%$search%";

0 comments on commit bf0aa89

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