From ac86edd01a2ea0266b0e4779b7229b15750ac4fc Mon Sep 17 00:00:00 2001 From: Petr Skoda Date: Fri, 17 Sep 2010 12:35:22 +0000 Subject: [PATCH] fixed category sync cleanup --- enrol/category/locallib.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/enrol/category/locallib.php b/enrol/category/locallib.php index 1be7c71e143..0b8137f7506 100644 --- a/enrol/category/locallib.php +++ b/enrol/category/locallib.php @@ -250,7 +250,9 @@ function enrol_category_sync_full() { if (!$roles = get_roles_with_capability('enrol/category:synchronised', CAP_ALLOW, $syscontext)) { // yay, nothing to do, so let's remove all leftovers if ($instances = $DB->get_records('enrol', array('enrol'=>'category'))) { - $plugin->delete_instance($instance); + foreach ($instances as $instance) { + $plugin->delete_instance($instance); + } } }