Skip to content

Commit e61fe5e

Browse files
committedMar 21, 2014
improvements for restore course
1 parent a5661db commit e61fe5e

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed
 

‎.htaccess_install

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
php_value memory_limit 25M
1+
php_value memory_limit 48M
22
php_value upload_max_filesize 80M
33
php_value post_max_size 80M
44
php_value max_execution_time 100

‎modules/course_info/restore_course.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@
169169
} else if ($restoreHelper->getBackupVersion() === RestoreHelper::STYLE_2X) {
170170
create_modules($course_id);
171171
}
172-
restore_table($restoreThis, 'announcement', array('set' => array('course_id' => $course_id), 'delete' => array('id')));
172+
restore_table($restoreThis, 'announcement', array('set' => array('course_id' => $course_id), 'delete' => array('id', 'preview')));
173173
restore_table($restoreThis, 'group_properties', array('set' => array('course_id' => $course_id)));
174174
$group_map = restore_table($restoreThis, 'group', array('set' => array('course_id' => $course_id), 'return_mapping' => 'id'));
175175
restore_table($restoreThis, 'group_members', array('map' => array('group_id' => $group_map, 'user_id' => $userid_map)));
@@ -195,7 +195,9 @@
195195
&& isset($backupData['query']) && is_array($backupData['query'])) {
196196
$postsText = get_tabledata_from_parsed('posts_text');
197197
foreach ($postsText as $ptData) {
198-
Database::get()->query("UPDATE forum_post SET post_text = ?s WHERE id = ?d", $ptData['post_text'], intval($forum_post_map[$ptData['post_id']]));
198+
if (array_key_exists($ptData['post_id'], $forum_post_map)) {
199+
Database::get()->query("UPDATE forum_post SET post_text = ?s WHERE id = ?d", $ptData['post_text'], intval($forum_post_map[$ptData['post_id']]));
200+
}
199201
}
200202
}
201203

0 commit comments

Comments
 (0)
Please sign in to comment.