From b317f67a3f747d56e211491a1e564faf02fed304 Mon Sep 17 00:00:00 2001 From: dongsheng Date: Mon, 3 Aug 2009 07:22:55 +0000 Subject: [PATCH] "MDL-19985, fixed undefined typeid, thanks for andrei's patch" --- repository/manage_instances.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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; -- 2.39.5