diff --git a/lib/portfolio/exporter.php b/lib/portfolio/exporter.php index 3baf0b5bcb3..79bfc8f6b4f 100644 --- a/lib/portfolio/exporter.php +++ b/lib/portfolio/exporter.php @@ -722,15 +722,18 @@ class portfolio_exporter { if ($this->get('user')->id != $USER->id) { // make sure it belongs to the right user throw new portfolio_exception('notyours', 'portfolio'); } - if (!$readonly && $this->get('instance') && !$this->get('instance')->allows_multiple_exports() - && ($already = portfolio_existing_exports($this->get('user')->id, $this->get('instance')->get('plugin'))) - && array_shift(array_keys($already)) != $this->get('id') - ) { - $a = (object)array( - 'plugin' => $this->get('instance')->get('plugin'), - 'link' => $CFG->wwwroot . '/user/portfoliologs.php', - ); - throw new portfolio_exception('nomultipleexports', 'portfolio', '', $a); + if (!$readonly && $this->get('instance') && !$this->get('instance')->allows_multiple_exports()) { + $already = portfolio_existing_exports($this->get('user')->id, $this->get('instance')->get('plugin')); + $already = array_keys($already); + + if (array_shift($already) != $this->get('id')) { + + $a = (object)array( + 'plugin' => $this->get('instance')->get('plugin'), + 'link' => $CFG->wwwroot . '/user/portfoliologs.php', + ); + throw new portfolio_exception('nomultipleexports', 'portfolio', '', $a); + } } if (!$this->caller->check_permissions()) { // recall the caller permission check throw new portfolio_caller_exception('nopermissions', 'portfolio', $this->caller->get_return_url()); diff --git a/mod/assign/portfolio_callback.php b/mod/assign/portfolio_callback.php index cee75bcd272..71e6d820e5d 100644 --- a/mod/assign/portfolio_callback.php +++ b/mod/assign/portfolio_callback.php @@ -45,6 +45,9 @@ class assign_portfolio_caller extends portfolio_module_caller_base { /** @var int callback arg - the id of submission we export */ protected $sid; + /** @var string component of the submission files we export*/ + protected $component; + /** @var string callback arg - the area of submission files we export */ protected $area; @@ -60,7 +63,6 @@ class assign_portfolio_caller extends portfolio_module_caller_base { /** @var string callback arg - the name of the editor field we export */ protected $editor; - /** * callback arg for a single file export */ diff --git a/portfolio/boxnet/lib.php b/portfolio/boxnet/lib.php index 120f61e8030..a793767c072 100644 --- a/portfolio/boxnet/lib.php +++ b/portfolio/boxnet/lib.php @@ -37,8 +37,9 @@ class portfolio_plugin_boxnet extends portfolio_plugin_push_base { ) ); if (array_key_exists('status', $return) && $return['status'] == 'upload_ok' - && array_key_exists('id', $return) && count($return['id']) == 1) { - $this->rename_file($return['id'][array_pop(array_keys($return['id']))], $file->get_filename()); + && array_key_exists('id', $return) && count($return['id']) == 1) { + $returnid = array_keys($return['id']); + $this->rename_file($return['id'][array_pop($returnid)], $file->get_filename()); // if this fails, the file was sent but not renamed - this triggers a warning but is not fatal. } }