From 489d8a755cbefcb06ce6aab3cfbd0a7b0a9d5a94 Mon Sep 17 00:00:00 2001 From: Dongsheng Cai Date: Thu, 1 Apr 2010 06:09:53 +0000 Subject: [PATCH] "MDL-13766, check if plugin file existed before displayed in admin page" --- repository/lib.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/repository/lib.php b/repository/lib.php index 5f75ee3e114..7dcf4cef268 100644 --- a/repository/lib.php +++ b/repository/lib.php @@ -514,7 +514,7 @@ abstract class repository { * @return array Repository types */ public static function get_types($visible=null) { - global $DB; + global $DB, $CFG; $types = array(); $params = null; @@ -523,7 +523,9 @@ abstract class repository { } if ($records = $DB->get_records('repository',$params,'sortorder')) { foreach($records as $type) { - $types[] = new repository_type($type->type, (array)get_config($type->type), $type->visible, $type->sortorder); + if (file_exists($CFG->dirroot . '/repository/'. $type->type .'/repository.class.php')) { + $types[] = new repository_type($type->type, (array)get_config($type->type), $type->visible, $type->sortorder); + } } } -- 2.43.0