Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
"MDL-23990, fixed sql condition, repository recent plugin"
  • Loading branch information
Dongsheng Cai committed Aug 30, 2010
1 parent 91a774e commit 94c4bd4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions repository/recent/lib.php
Expand Up @@ -59,10 +59,10 @@ private function get_recent_files($limitfrom = 0, $limit = DEFAULT_RECENT_FILES_
$sql = 'SELECT * FROM {files} files1
JOIN (SELECT contenthash, filename, MAX(id) AS id
FROM {files}
WHERE (userid = ? AND filename != ?) OR (filearea = ? AND itemid = ?)
WHERE userid = ? AND filename != ? AND ((filearea = ? AND itemid = ?) OR filearea != ?)
GROUP BY contenthash, filename) files2 ON files1.id = files2.id
ORDER BY files1.timemodified DESC';
$params = array('userid'=>$USER->id, 'filename'=>'.', 'filearea'=>'draft', 'itemid'=>$itemid);
$params = array('userid'=>$USER->id, 'filename'=>'.', 'filearea'=>'draft', 'itemid'=>$itemid, 'draft');
$rs = $DB->get_recordset_sql($sql, $params, $limitfrom, $limit);
$result = array();
foreach ($rs as $file_record) {
Expand Down

0 comments on commit 94c4bd4

Please sign in to comment.