assignment MDL-22609 reverting to userid as print_user_files is updated to lookup...
authorAparup Banerjee <nebgor@gmail.com>
Fri, 30 Jul 2010 02:39:38 +0000 (02:39 +0000)
committerAparup Banerjee <nebgor@gmail.com>
Fri, 30 Jul 2010 02:39:38 +0000 (02:39 +0000)
mod/assignment/lib.php

index ee8726c..817ea85 100644 (file)
@@ -1760,7 +1760,7 @@ class assignment_base {
                 $filename = $file->get_filename();
                 $found = true;
                 $mimetype = $file->get_mimetype();
-                $path = file_encode_url($CFG->wwwroot.'/pluginfile.php', '/'.$this->context->id.'/mod_assignment/submission/'.$userid.'/'.$filename);
+                $path = file_encode_url($CFG->wwwroot.'/pluginfile.php', '/'.$this->context->id.'/mod_assignment/submission/'.$submission->id.'/'.$filename);
                 $output .= '<a href="'.$path.'" ><img src="'.$OUTPUT->pix_url(file_mimetype_icon($mimetype)).'" class="icon" alt="'.$mimetype.'" />'.s($filename).'</a>';
                 if ($this->portfolio_exportable() && has_capability('mod/assignment:exportownsubmission', $this->context)) {
                     $button->set_callback_options('assignment_portfolio_caller', array('id' => $this->cm->id, 'fileid' => $file->get_id()), '/mod/assignment/locallib.php');