]> git.mjollnir.org Git - moodle.git/commitdiff
portfolio MDL-19356 fixing missing global user in multi-export check
authorPenny Leach <penny@liip.ch>
Thu, 19 Nov 2009 06:49:57 +0000 (06:49 +0000)
committerPenny Leach <penny@liip.ch>
Thu, 19 Nov 2009 06:49:57 +0000 (06:49 +0000)
lib/portfoliolib.php

index 2a1fe809b52ea01517c8182f0818026dc919aaa9..7afb72a7ba32a54036b9698def4b1ec9adad8607 100644 (file)
@@ -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" . '<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";