From add93b8f8f91b7ed2c9f550d347ca0feb18aac11 Mon Sep 17 00:00:00 2001 From: Penny Leach Date: Thu, 19 Nov 2009 06:49:57 +0000 Subject: [PATCH] portfolio MDL-19356 fixing missing global user in multi-export check --- lib/portfoliolib.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/portfoliolib.php b/lib/portfoliolib.php index 2a1fe809b5..7afb72a7ba 100644 --- a/lib/portfoliolib.php +++ b/lib/portfoliolib.php @@ -202,7 +202,7 @@ class portfolio_add_button { * 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 @@ class portfolio_add_button { $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 @@ class portfolio_add_button { } 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" . ''; @@ -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" . "\n"; -- 2.39.5