Skip to content

Commit

Permalink
MDL-15904 fixed problem in interrupted assignment file migration
Browse files Browse the repository at this point in the history
  • Loading branch information
skodak committed Aug 16, 2008
1 parent 775f811 commit b91807e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mod/assignment/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ function xmldb_assignment_upgrade($oldversion) {
if ($filename === '') {
continue;
}
if (!$fs->file_exists($context->id, $filearea, '0', '/', $filename)) {
if (!$fs->file_exists($context->id, $filearea, $submission->userid, '/', $filename)) {
$file_record = array('contextid'=>$context->id, 'filearea'=>$filearea, 'itemid'=>$submission->userid, 'filepath'=>'/', 'filename'=>$filename, 'userid'=>$submission->userid);
if ($fs->create_file_from_pathname($file_record, $path.$item->getFilename())) {
unlink($path.$item->getFilename());
Expand All @@ -108,7 +108,7 @@ function xmldb_assignment_upgrade($oldversion) {
if ($filename === '') {
continue;
}
if (!$fs->file_exists($context->id, $filearea, '0', '/', $filename)) {
if (!$fs->file_exists($context->id, $filearea, $submission->userid, '/', $filename)) {
$file_record = array('contextid'=>$context->id, 'filearea'=>$filearea, 'itemid'=>$submission->userid, 'filepath'=>'/', 'filename'=>$filename,
'timecreated'=>$item->getCTime(), 'timemodified'=>$item->getMTime());
if ($submission->teacher) {
Expand Down

0 comments on commit b91807e

Please sign in to comment.