MDL-15758 - fixing bugs nico found in testing

This commit is contained in:
mjollnir_
2008-08-14 12:40:20 +00:00
parent 599e379d16
commit 899ffdfbdd
3 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -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();
@@ -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 .= '<br />';
+1 -1
View File
@@ -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;