Skip to content

Commit

Permalink
MDL-49490 assign: can't export to portfolio on non-submission
Browse files Browse the repository at this point in the history
  • Loading branch information
danpoltawski committed Nov 18, 2015
1 parent 26653c8 commit a49fca4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mod/assign/renderable.php
Original file line number Diff line number Diff line change
Expand Up @@ -788,7 +788,7 @@ public function __construct(context $context, $sid, $filearea, $component) {

if (!empty($CFG->enableportfolios)) {
require_once($CFG->libdir . '/portfoliolib.php');
if (count($files) >= 1 &&
if (count($files) >= 1 && !empty($sid) &&
has_capability('mod/assign:exportownsubmission', $this->context)) {
$button = new portfolio_add_button();
$callbackparams = array('cmid' => $this->cm->id,
Expand Down Expand Up @@ -823,6 +823,7 @@ public function preprocess($dir, $filearea, $component) {
foreach ($dir['files'] as $file) {
$file->portfoliobutton = '';
if (!empty($CFG->enableportfolios)) {
require_once($CFG->libdir . '/portfoliolib.php');
$button = new portfolio_add_button();
if (has_capability('mod/assign:exportownsubmission', $this->context)) {
$portfolioparams = array('cmid' => $this->cm->id, 'fileid' => $file->get_id());
Expand Down

0 comments on commit a49fca4

Please sign in to comment.