From: mjollnir_ Date: Thu, 14 Aug 2008 12:40:20 +0000 (+0000) Subject: MDL-15758 - fixing bugs nico found in testing X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=899ffdfbdd7b0b6e44fbf02df244bfa5a7aaf44c;p=moodle.git MDL-15758 - fixing bugs nico found in testing --- diff --git a/mod/assignment/lib.php b/mod/assignment/lib.php index 1ae83494bf..d256dd1227 100644 --- a/mod/assignment/lib.php +++ b/mod/assignment/lib.php @@ -3169,7 +3169,7 @@ class assignment_portfolio_caller extends portfolio_module_caller_base { $fs = get_file_storage(); $status = true; if ($this->file) { - return $fs->get_file($this->file)->get_contenthash(); + return $fs->get_file_by_id($this->file)->get_contenthash(); } if ($files = $fs->get_area_files($this->assignment->context->id, 'assignment_submission', $this->user->id, '', false)) { $sha1s = array(); diff --git a/mod/assignment/type/upload/assignment.class.php b/mod/assignment/type/upload/assignment.class.php index d97988b6b5..51d5f9d03b 100644 --- a/mod/assignment/type/upload/assignment.class.php +++ b/mod/assignment/type/upload/assignment.class.php @@ -361,7 +361,7 @@ class assignment_upload extends assignment_base { } if (has_capability('mod/assignment:exportownsubmission', $this->context)) { - $p['file'] = $filename; + $p['file'] = $file->get_id(); $output .= portfolio_add_button('assignment_portfolio_caller', $p, '/mod/assignment/lib.php', false, true); } $output .= '
'; diff --git a/portfolio/type/boxnet/lib.php b/portfolio/type/boxnet/lib.php index 471ea50b26..0d302a73d3 100644 --- a/portfolio/type/boxnet/lib.php +++ b/portfolio/type/boxnet/lib.php @@ -215,7 +215,7 @@ class portfolio_plugin_boxnet extends portfolio_plugin_push_base { $prefix = implode('.', $bits); } while (true) { - if (!in_array($newname, $this->accounttree['file_name'])) { + if (!array_key_exists('file_name', $this->accounttree) || !in_array($newname, $this->accounttree['file_name'])) { return $this->boxclient->renameFile($fileid, $newname); } $newname = $prefix . '(' . $count . ')' . $suffix;