-
Bug
-
Resolution: Fixed
-
Major
-
2.0.2
-
CentOS 5.5, Oracle 10g, PHP 5.3.5 with oci8 library
-
Oracle
-
MOODLE_20_STABLE
-
MOODLE_20_STABLE
-
MDL-27286_master -
Easy
-
The query for selecting the recent files doesn't work with Oracle 10g database. (a duplication of name in the columns returned makes the query fails, with no data returned).
The file involved in the error is:
{moodle_root}/repository/recent/lib.php around line 56, function 'get_recent_files'changing the select part of the SQL query from
$sql = 'SELECT * FROM {files} files1
JOIN (SELECT contenthash, filename, MAX(id) AS id
FROM {files}
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';
to:
$sql = 'SELECT * FROM {files} files1
JOIN (SELECT contenthash, MAX(id) AS id
FROM {files}
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';
solves the problem.
Attached the modified version of the file {moodle_root}
/repository/recent/lib.php