MDL-15758 - remove dependence on 'userid' callback parameter in assignment portfolio...
authormjollnir_ <mjollnir_>
Fri, 5 Sep 2008 12:44:46 +0000 (12:44 +0000)
committermjollnir_ <mjollnir_>
Fri, 5 Sep 2008 12:44:46 +0000 (12:44 +0000)
mod/assignment/lib.php
mod/assignment/type/upload/assignment.class.php

index 566ee4c..8f248ae 100644 (file)
@@ -1706,7 +1706,6 @@ class assignment_base {
 
         if ($files = $fs->get_area_files($this->context->id, 'assignment_submission', $userid, "timemodified", false)) {
             $p = array(
-                'userid' => $userid,
                 'assignmentid' => $this->cm->id,
             );
             foreach ($files as $file) {
@@ -3167,7 +3166,8 @@ class assignment_portfolio_caller extends portfolio_module_caller_base {
         if (!$this->assignment->portfolio_exportable()) {
             throw new portfolio_caller_exception('notexportable', 'portfolio', $this->get_return_url());
         }
-        $this->userid = $callbackargs['userid'];
+        global $USER;
+        $this->userid = $USER->id;
         $this->file = (array_key_exists('file', $callbackargs)) ? $callbackargs['file'] : null;
     }
 
index 65686cc..922986b 100644 (file)
@@ -343,7 +343,6 @@ class assignment_upload extends assignment_base {
 
         if ($files = $fs->get_area_files($this->context->id, 'assignment_submission', $userid, "timemodified", false)) {
             $p = array(
-                'userid' => $userid,
                 'assignmentid' => $this->cm->id,
             );
             foreach ($files as $file) {