MDL-27840 course: prevent warnings on half-uninstall mod
authorDan Poltawski <dan@moodle.com>
Wed, 30 Dec 2015 14:12:54 +0000 (14:12 +0000)
committerDan Poltawski <dan@moodle.com>
Wed, 30 Dec 2015 14:12:54 +0000 (14:12 +0000)
lib/modinfolib.php

index 03a9dd1..ff0a4f7 100644 (file)
@@ -492,7 +492,7 @@ class course_modinfo {
         // Loop through each piece of module data, constructing it
         static $modexists = array();
         foreach ($coursemodinfo->modinfo as $mod) {
-            if (strval($mod->name) === '') {
+            if (!isset($mod->name) || strval($mod->name) === '') {
                 // something is wrong here
                 continue;
             }