You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 3, 2024. It is now read-only.
The timemodified field in the files table does not get updated when a file is copied to a new course. Use the id field in the files table to sort instead. Ideally, we want a specific number of unique contenthashes that reflect the most recently used files. The largest files.id value should be the most recently updated file.
FROM: $query = 'SELECT distinct f.contenthash, f.timemodified FROM {files} f, {context} c WHERE c.id = f.contextid AND c.contextlevel = 70 AND f.filesize <> 0 AND f.mimetype = "application/pdf" AND f.component != "assignfeedback_editpdf" AND f.filearea != "stamps" AND f.contenthash NOT IN (SELECT contenthash FROM {block_filescan_files} where checked=True or (checked=False and status="error" and statuscode >=' . $max_retries . ')) ORDER BY f.timemodified DESC LIMIT ' . $max_files_to_check;
To: (maybe) $query = 'SELECT f.contenthash, f.id FROM {files} f, {context} c WHERE c.id = f.contextid AND c.contextlevel = 70 AND f.filesize <> 0 AND f.mimetype = "application/pdf" AND f.component != "assignfeedback_editpdf" AND f.filearea != "stamps" AND f.contenthash NOT IN (SELECT contenthash FROM {block_filescan_files} where checked=True or (checked=False and status="error" and statuscode >=' . $max_retries . ')) ORDER BY f.id DESC LIMIT ' . $max_files_to_check;