Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MDL-33828 Portfolio: prevent notices while exporting to portfolios

  • Loading branch information...
commit 3e1648723ffd71c4340d84ed53c420945305671c 1 parent 60a72a0
@FMCorz FMCorz authored samhemelryk committed
View
21 lib/portfolio/exporter.php
@@ -722,15 +722,18 @@ public function verify_rewaken($readonly=false) {
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());
View
4 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
*/
View
5 portfolio/boxnet/lib.php
@@ -37,8 +37,9 @@ public function send_package() {
)
);
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.
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.