From: dongsheng Date: Mon, 3 Aug 2009 07:22:55 +0000 (+0000) Subject: "MDL-19985, fixed undefined typeid, thanks for andrei's patch" X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=b317f67a3f747d56e211491a1e564faf02fed304;p=moodle.git "MDL-19985, fixed undefined typeid, thanks for andrei's patch" --- diff --git a/repository/manage_instances.php b/repository/manage_instances.php index 3b7dff6249..8ea582eea8 100644 --- a/repository/manage_instances.php +++ b/repository/manage_instances.php @@ -58,10 +58,10 @@ $type = repository::get_type_by_typename($new); } else if (!empty($edit)){ $instance = repository::get_instance($edit); - $type = repository::get_type_by_id($instance->typeid); + $type = repository::get_type_by_id($instance->options['typeid']); } else if (!empty($delete)){ $instance = repository::get_instance($delete); - $type = repository::get_type_by_id($instance->typeid); + $type = repository::get_type_by_id($instance->options['typeid']); } if (isset($type) && ( !$type->get_visible() || (!$type->get_contextvisibility($context->contextlevel)) ) ) { print_error('typenotvisible', 'repository', $baseurl); @@ -108,11 +108,11 @@ if ($instance->readonly) { throw new repository_exception('readonlyinstance', 'repository'); } - $instancetype = repository::get_type_by_id($instance->typeid); + $instancetype = repository::get_type_by_id($instance->options['typeid']); $classname = 'repository_' . $instancetype->get_typename(); $configs = $instance->get_instance_option_names(); $plugin = $instancetype->get_typename(); - $typeid = $instance->typeid; + $typeid = $instance->options['typeid']; } else { $plugin = $new; $typeid = $new;