Permalink
Browse files

MDL-49490 assign: can't export to portfolio on non-submission

  • Loading branch information...
danpoltawski committed Nov 4, 2015
1 parent 6114fab commit 96a2e4086f4d09df85796ed8bcfe3a5cca64102f
Showing with 2 additions and 1 deletion.
  1. +2 −1 mod/assign/renderable.php
@@ -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,
@@ -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());

0 comments on commit 96a2e40

Please sign in to comment.