diff --git a/mod/assignment/lib.php b/mod/assignment/lib.php
index <HASH>..<HASH> 100644
--- a/mod/assignment/lib.php
+++ b/mod/assignment/lib.php
@@ -1892,7 +1892,7 @@ class assignment_base {
                 $output .= plagiarism_get_links(array('userid'=>$userid, 'file'=>$file, 'cmid'=>$this->cm->id, 'course'=>$this->course, 'assignment'=>$this->assignment));
                 $output .= '<br />';
             }
-            if (count($files) > 1  && $this->portfolio_exportable() && has_capability('mod/assignment:exportownsubmission', $this->context)) {
+            if ($CFG->enableportfolios && count($files) > 1  && $this->portfolio_exportable() && has_capability('mod/assignment:exportownsubmission', $this->context)) {
                 $button->set_callback_options('assignment_portfolio_caller', array('id' => $this->cm->id), '/mod/assignment/locallib.php');
                 $output .= '<br />'  . $button->to_html();
             }
MDL-<I> portfolio: Added ->portfolioenabled check to one more place