Skip to content
Permalink
Browse files

portfolio MDL-19356 fixing missing global user in multi-export check

  • Loading branch information...
Penny Leach
Penny Leach committed Nov 19, 2009
1 parent bd39808 commit add93b8f8f91b7ed2c9f550d347ca0feb18aac11
Showing with 5 additions and 3 deletions.
  1. +5 −3 lib/portfoliolib.php
@@ -202,7 +202,7 @@ public function render($format=null, $addstr=null) {
* this is whole string, not key. optional, defaults to 'Add to portfolio';
*/
public function to_html($format=null, $addstr=null) {
global $CFG, $COURSE, $OUTPUT;
global $CFG, $COURSE, $OUTPUT, $USER;
if (!$this->is_renderable()) {
return;
}
@@ -240,7 +240,7 @@ public function to_html($format=null, $addstr=null) {
$formats = portfolio_supported_formats_intersect($this->formats, $instance->supported_formats());
if (count($formats) == 0) {
// bail. no common formats.
debugging(get_string('nocommonformats', 'portfolio', $this->callbackclass));
debugging(get_string('nocommonformats', 'portfolio', (object)array('location' => $this->callbackclass, 'formats' => implode(',', $this->formats))));
return;
}
if ($error = portfolio_instance_sanity_check($instance)) {
@@ -254,6 +254,7 @@ public function to_html($format=null, $addstr=null) {
}
if ($this->file && $this->file instanceof stored_file && !$instance->file_mime_check($this->file->get_mimetype())) {
// bail, we have a specific file and this plugin doesn't support it
debugging(get_string('mimecheckfail', 'portfolio', (object)array('plugin' => $instance->get('plugin'), 'mimetype' => $this->file->get_mimetype())));
return;
}
$formoutput .= "\n" . '<input type="hidden" name="instance" value="' . $instance->get('id') . '" />';
@@ -395,6 +396,7 @@ function portfolio_instance_select($instances, $callerformats, $callbackclass, $
continue;
}
if ($file && $file instanceof stored_file && !$instance->file_mime_check($file->get_mimetype())) {
debugging(get_string('mimecheckfail', 'portfolio', (object)array('plugin' => $instance->get('plugin'), 'mimetype' => $this->file->get_mimetype())));
// bail, we have a specific file and this plugin doesn't support it
continue;
}
@@ -404,7 +406,7 @@ function portfolio_instance_select($instances, $callerformats, $callbackclass, $
}
if (empty($count)) {
// bail. no common formats.
debugging(get_string('nocommonformats', 'portfolio', $callbackclass));
debugging(get_string('nocommonformats', 'portfolio', (object)array('location' => $callbackclass, 'formats' => implode(',', $callerformats))));
return;
}
$selectoutput .= "\n" . "</select>\n";

0 comments on commit add93b8

Please sign in to comment.
You can’t perform that action at this time.