]> git.mjollnir.org Git - moodle.git/commitdiff
If the name of an activity is left blank, then give it a generic name
authormoodler <moodler>
Sat, 14 Aug 2004 12:15:28 +0000 (12:15 +0000)
committermoodler <moodler>
Sat, 14 Aug 2004 12:15:28 +0000 (12:15 +0000)
matching the name of the module.

course/mod.php

index 15e62854db8bd8c9664a1059a3654b1595c96d1f..527662c8f68028648ccf0815cf313faaa85266af 100644 (file)
 
         switch ($mod->mode) {
             case "update":
+
+                if (trim($mod->name) == '') {
+                    unset($mod->name);
+                }
+
                 $return = $updateinstancefunction($mod);
                 if (!$return) {
                     if (file_exists($moderr)) {
                 break;
 
             case "add":
+
+                if (trim($mod->name) == '') {
+                    $mod->name = get_string("modulename", $mod->modulename);
+                }
+
                 $return = $addinstancefunction($mod);
                 if (!$return) {
                     if (file_exists($moderr)) {