MDL-32592 enrol_imsenterprise: fix error when category not defined
authorDan Poltawski <dan@moodle.com>
Thu, 26 Sep 2013 06:56:56 +0000 (14:56 +0800)
committerDan Poltawski <dan@moodle.com>
Thu, 26 Sep 2013 07:00:15 +0000 (15:00 +0800)
thanks to Henrik Thorn for the fix

enrol/imsenterprise/lib.php

index f9ac4ca..15204c3 100644 (file)
@@ -400,7 +400,7 @@ function process_group_tag($tagcontents) {
                     // Insert default names for teachers/students, from the current language
 
                     // Handle course categorisation (taken from the group.org.orgunit field if present)
-                    if (strlen($group->category)>0) {
+                    if (!empty($group->category)) {
                         // If the category is defined and exists in Moodle, we want to store it in that one
                         if ($catid = $DB->get_field('course_categories', 'id', array('name'=>$group->category))) {
                             $course->category = $catid;