From: tjhunt Date: Thu, 10 Jan 2008 14:17:37 +0000 (+0000) Subject: Fix notice when you try to import an empty XML file. X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=77e2e3f2b88dd7b0070d491ed60601229f8402c2;p=moodle.git Fix notice when you try to import an empty XML file. --- diff --git a/grade/import/xml/lib.php b/grade/import/xml/lib.php index e019cdc449..c581f898e7 100644 --- a/grade/import/xml/lib.php +++ b/grade/import/xml/lib.php @@ -37,7 +37,8 @@ function import_xml_grades($text, $course, &$error) { $content = xmlize($text); - if ($results = $content['results']['#']['result']) { + if (!empty($content['results']['#']['result'])) { + $results = $content['results']['#']['result']; foreach ($results as $i => $result) { if (!$grade_items = grade_item::fetch_all(array('idnumber'=>$result['#']['assignment'][0]['#'], 'courseid'=>$course->id))) {