]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-16517 - fix regression i introduced in resource mod portfolio implementation
authormjollnir_ <mjollnir_>
Mon, 15 Sep 2008 19:39:46 +0000 (19:39 +0000)
committermjollnir_ <mjollnir_>
Mon, 15 Sep 2008 19:39:46 +0000 (19:39 +0000)
mod/resource/lib.php

index 14f2b31a1c5ed8d66bf2786f71b16fdaa5288d3c..6eb9dee09d623a55e1bd1d919f32d8f4aab8e070 100644 (file)
@@ -727,7 +727,7 @@ class resource_portfolio_caller extends portfolio_module_caller_base {
         $this->resourcefile = $CFG->dirroot.'/mod/resource/type/'.$this->cm->type.'/resource.class.php';
         require_once($this->resourcefile);
         $this->resource= new $resourceclass($this->cm->id);
-        if (!is_callable(array($resource, 'portfolio_prepare_package')) || !is_callable(array($resource, 'portfolio_get_sha1'))) {
+        if (!is_callable(array($this->resource, 'portfolio_prepare_package')) || !is_callable(array($this->resource, 'portfolio_get_sha1'))) {
             throw new portfolio_exception('portfolionotimplemented', 'resource', null, $this->cm->type);
         }
         $this->supportedformats = array(self::type_to_format($this->cm->type));
@@ -778,8 +778,8 @@ class resource_portfolio_caller extends portfolio_module_caller_base {
             debugging(get_string('portfolionotimplemented', 'resource'));
             return false;
         }
-        $callersupports = array(self::type_to_format($resource->cm->type));
-        if ($resource->cm->type == 'file') {
+        $callersupports = array(self::type_to_format($resource->resource->type));
+        if ($resource->resource->type == 'file') {
             // $callersupports = array(portfolio_format_from_file($file);
         }
         $button = new portfolio_add_button();