mirror of
https://github.com/moodle/moodle.git
synced 2025-03-14 12:40:01 +01:00
MDL-16072 memory related improvements
This commit is contained in:
parent
e1266a52f0
commit
1f0e77025d
@ -115,7 +115,7 @@ function xmldb_forum_upgrade($oldversion) {
|
||||
|
||||
$count = $DB->count_records_sql("SELECT COUNT('x') $sqlfrom");
|
||||
|
||||
if ($rs = $DB->get_recordset_sql("SELECT p.*, d.forum, f.course, cm.id AS cmid $sqlfrom")) {
|
||||
if ($rs = $DB->get_recordset_sql("SELECT p.id, p.attachment, d.forum, f.course, cm.id AS cmid $sqlfrom")) {
|
||||
|
||||
$pbar = new progress_bar('migrateforumfiles', 500, true);
|
||||
|
||||
|
@ -3787,7 +3787,7 @@ function forum_move_attachments($discussion, $forumfrom, $forumto) {
|
||||
$oldcontext = get_context_instance(CONTEXT_MODULE, $oldcm->id);
|
||||
|
||||
// loop through all posts, better not use attachment flag ;-)
|
||||
if ($posts = $DB->get_records('forum_posts', array('discussion'=>$discussion->id))) {
|
||||
if ($posts = $DB->get_records('forum_posts', array('discussion'=>$discussion->id), '', 'id, attachment')) {
|
||||
foreach ($posts as $post) {
|
||||
if ($oldfiles = $fs->get_area_files($oldcontext->id, 'forum_attachment', $post->id, "id", false)) {
|
||||
foreach ($oldfiles as $oldfile) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user