]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-15758 - fixing bugs nico found in testing
authormjollnir_ <mjollnir_>
Thu, 14 Aug 2008 12:40:20 +0000 (12:40 +0000)
committermjollnir_ <mjollnir_>
Thu, 14 Aug 2008 12:40:20 +0000 (12:40 +0000)
mod/assignment/lib.php
mod/assignment/type/upload/assignment.class.php
portfolio/type/boxnet/lib.php

index 1ae83494bf801920b96715346012505d750203d9..d256dd1227b2932a6a8fa62b04d3870f7bdd5698 100644 (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();
index d97988b6b5e97c1e248857caf836a32e513790d3..51d5f9d03bf8ba5d7ab4f8438002572a21f92f1c 100644 (file)
@@ -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 />';
index 471ea50b26a122a5fff86e29f8152751b5462072..0d302a73d3de22cb1201d1ad37408deade454756 100644 (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;