assignment MDL-22609 notice when no submission yet - fixed.
authorAparup Banerjee <nebgor@gmail.com>
Thu, 29 Jul 2010 08:12:58 +0000 (08:12 +0000)
committerAparup Banerjee <nebgor@gmail.com>
Thu, 29 Jul 2010 08:12:58 +0000 (08:12 +0000)
mod/assignment/lib.php

index 0fd89b8..ee8726c 100644 (file)
@@ -1752,7 +1752,7 @@ class assignment_base {
 
         $submission = $this->get_submission($userid);
 
 
         $submission = $this->get_submission($userid);
 
-        if ($files = $fs->get_area_files($this->context->id, 'mod_assignment', 'submission', $submission->id, "timemodified", false)) {
+        if (($submission) && $files = $fs->get_area_files($this->context->id, 'mod_assignment', 'submission', $submission->id, "timemodified", false)) {
             require_once($CFG->libdir.'/portfoliolib.php');
             require_once($CFG->dirroot . '/mod/assignment/locallib.php');
             $button = new portfolio_add_button();
             require_once($CFG->libdir.'/portfoliolib.php');
             require_once($CFG->dirroot . '/mod/assignment/locallib.php');
             $button = new portfolio_add_button();